• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to tell if session loaded?

#4
I don't believe the $_SESSION variable is available until the session has been initiated, IIRC. So you could do isset($_SESSION).

Or you could not worry about checking, since as long as you use the session() helper method, it will be automatically started on the first use. Trying to grab a variable like with $key = session('some_key') will ensure the session is started before grabbing the value.
Support Development  • Practical CodeIgniter 3  •
Myth:AuthVulcan - CLI Tools for CI4
Reply


Messages In This Thread
How to tell if session loaded? - by skunkbad - 09-15-2018, 10:36 AM
RE: How to tell if session loaded? - by kilishan - 09-16-2018, 11:44 AM
RE: How to tell if session loaded? - by skunkbad - 09-16-2018, 01:50 PM
RE: How to tell if session loaded? - by kilishan - 09-16-2018, 02:43 PM
RE: How to tell if session loaded? - by skunkbad - 09-16-2018, 10:09 PM
RE: How to tell if session loaded? - by InsiteFX - 09-17-2018, 04:02 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.