Page 1 of 1

howto detect if session_start is called

Posted: Wed Jul 28, 2004 8:37 am
by tores
Hi

How do I check if session_start() is called. (So I can call session_unset() and session_destroy()).

Regards tores

Posted: Wed Jul 28, 2004 8:42 am
by ol4pr0

Code: Select all

print_r ($_SESSION);
or

Code: Select all

echo $_COOKIE['PHPSESSID'];

Posted: Wed Jul 28, 2004 9:17 am
by patrikG
checking cookies to verify whether a session has started is highly unreliable. Use [php_man]session_is_registered[/php_man] or write your own session handler (details at: http://uk.php.net/manual/en/function.se ... andler.php)