Jump to content

Will Non-Existent Sessions always return FALSE?


snday

Recommended Posts

I'm pretty sure the answer is yes, but want to be certain.

Let me try to explain if you dont already understand from the title.

I create a default session value for a user on my site, lets say the value is:
$_SESSION['is_logged'] = TRUE;

I then do certain checks with this session.
Lets say I do not want a user to see something IF $_SESSION['is_logged'] == FALSE;

When a user first visits the website, no session is created, but will on next pageload.
Same for many Bots.. they dont generate sessions.
So if I want to check $_SESSION['is_logged'] == FALSE;
will it always return FALSE if that session is not there/not created?
[quote author=thorpe link=topic=116341.msg473963#msg473963 date=1164548347]
[code=php:0]$_SESSION['is_logged'] == FALSE[/code]

Will allways return TRUE if the session has not been set. (Be carefull how you word things)
[/quote]

crap,
what I ment was the reverse.

Basically I am wondering....
If a Session is NOT created, it will always return FALSE if checking for it correct?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.