View Full Version : Resolved does the die function destroy the session?

03-29-2010, 02:35 PM
The scenario is:
- i start a session
- if some condition is not fulfilled: die

But: does the die function destroy the session as well? Or I should do something like:

if(//condition not fulfilled){

is this necessary, as a double protection?

03-29-2010, 02:41 PM
die() just ends the script, to destroy the session you need to use session_destroy();

03-29-2010, 02:49 PM
What angst said is true. DIE will stop the script at that point. That's all it does, nothing more. It's used so there isn't forever loops or anything.

You can unset session variables, or use session_destroy.

03-29-2010, 02:51 PM
I'd chuck a session_unset in with the session_destroy for good measure.

03-29-2010, 03:11 PM
Thank you all. I will destroy the session before die :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum