How to access two different PHP sessions in the same PHP script?
I've tried this:
session_name('mys1');
session_start();
var_dump($_SESSION);
session_name('mys2');
session_start();
var_dump($_SESSION);but both var_dumps dump the session 'mys1' data.
I've also tried putting a session_destroy() in between:
session_name('mys1');
session_start();
var_dump($_SESSION);
session_destroy();
session_name('mys2');
session_start();
var_dump($_SESSION);that actually var_dumps the two different sessions
correctly but after that the 'mys1' session is gone.
No comments:
Post a Comment