Voting

: min(three, nine)?
(Example: nine)

The Note You're Voting On

forum at orthanc dot co dot nz
21 years ago
Becarful using this if you are trying to switch out of an existing session rather than load one into a clean slate.

session_decode doesn't destroy the existing session data, it will over write it if there is a session variable of the same name, but if the names don't clash the existing session variables will hang around.

I have yet to find a better solution than

session_destroy()
session_start()
session_decode(....);

-----------------------------------------
To explain what I'm talking about

<?
session_start();
$a = 5;
session_register('a');
session_decode("<session that doesn't have a as a session variable>");
print (session_is_registered('a') ? $a : 'Not Registered' );
?>

The above code will print '5' as $a hasn't been destroyed or even unregistered by the session_decode

<< Back to user notes page

To Top