Problem with session management - How to destroy a session
| From: | (CESBRON S.) | Date: | Fri, 10 Nov 2000 12:56:16 +0000 |
| Subject: | Problem with session management - How to destroy a session | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-4764@lists.php.net to get a copy of this message | ||
Hi,
First of all, I'm using PHP 4.03pl on a WIN 2000 running IIS 5.0. PHP is
plugged in as ISAPI.
I've got an active session that I want to destroy.
When I make session_destroy(), I get the following :
Warning: Session object destruction failed in D:\xxx\menu.php on line 7
I checked if the session was active. Here's my PHP code : (at the top of a
PHP page, the session is created in another page)
<?
session_start();
if(session_is_registered("ID"))
{ echo "La session existe et ID =$ID";
// session_unregister("ID");
// session_unregister("LOGIN");
session_destroy();
echo "<br>";
}
?>
and here's what I get at running time :
La session existe et ID =154
Warning: Session object destruction failed in D:\Sites
WEB\ESCNA\Php\CVtheque\menu.php on line 7
(I got the same with the above commented lines, uncommented).
I don't understand what happens.
Any suggestions will be greatly welcome.
Thanks
Stéphane
PS : I also try to open a session and to close it in a separate specific
file with <? session_destroy(); ?>
at the top of the file.
I got the following warning :
Warning: Trying to destroy uninitialized session in D:\xxx\essai.php on line 1
Stéphane Cesbron
Chargé du développement Internet/Intranet
AUDENCIA - Nantes.Ecole de Management
8 route de la Jonelière
B.P. 31222
44312 Nantes Cedex 3
Tél : 02.40.37.34.47
http ://www.audencia.com