Matthias Braun
Jun 7 2005, 07:00 PM
Help!
I try to delete at the end of the php-session either the cookies or the
sessionid (depending on cookies are allowed or not):
<?php
ini_set('session.use_trans_sid',1);
session_start();
unset($_SESSION['PHPSESSID']);
setcookie('PHPSESSID',FALSE,0);
?>
but it doesn't work. Who can help?
Thanks,
Matthias
Janwillem Borleffs
Jun 8 2005, 08:30 AM
Matthias Braun wrote:
QUOTE |
I try to delete at the end of the php-session either the cookies or the sessionid (depending on cookies are allowed or not):
|
It doesn't work that way, because a new PHPSESSID is created each time you
call session_start().
When your goal is to logout a user or something like that, you should unset
an identifier, e.g. ``loggedin'':
session_start();
if ($logout) {
unset($_SESSION['loggedin']);
}
JW
Denis WERNERT
Jun 14 2005, 08:17 AM
You may delete the session variables using session_destroy.
If you need a more complex behavior, you may overload the session handler
to gain full control over session handling.
Matthias Braun wrote:
QUOTE |
Help!
I try to delete at the end of the php-session either the cookies or the sessionid (depending on cookies are allowed or not):
<?php ini_set('session.use_trans_sid',1); session_start(); unset($_SESSION['PHPSESSID']); setcookie('PHPSESSID',FALSE,0); ?
but it doesn't work. Who can help?
Thanks,
Matthias |
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.