session_destroy returns FALSE :???????
| From: | Roberto Diaz | Date: | Sun, 14 Nov 1999 12:17:56 +0000 |
| Subject: | session_destroy returns FALSE :??????? | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-6256@lists.php.net to get a copy of this message | ||
Hi!
Acording to php's manual:
------------------------------------------------------------------
session_destroy
session_destroy -- Destroys all data registered to a session
Description
bool session_destroy(void);
session_destroy() destroys all of the data associated with the current
session.
This function always returns true.
-------------------------------------------------------------------------
But it can return FALSE... just try out of this code:
##############################################################################
[root@sirio test]# cat test1.php
<?
if(isset($nueva) && $nueva == 1){
$sid=session_destroy();
if($sid==FALSE) print "session_destroy() returns FALSE";
}
session_start();
if(!isset($sesion)){
$var = "Hello";
$var2 = 1;
$sesion = 1;
session_register("var");
session_register("var2");
session_register("sesion");
}
?>
<html>
<head> <title> Pagina de test 1 </title> </head>
<body bgcolor="#ffffff">
<center>
<p><h1> Registro de variables </h1></p><hr></hr>
<p><h3>Tu variables registrada $var:</h3> <?echo $var?></p>
<p><h3>Tu variable registrada $var2:</h3> <?echo $var2?></p>
<p>esta es la pagina 1. hacer click <a href="test2.php">aqui</a> para ir
a
la
pagina 2.</p>
</body>
</html>
-------------------------------------------------------------------------
[root@sirio test]# cat test2.php
<?session_start();?>
<html>
<body bgcolor="FFFFFF">
<center>
<h1>Y tus variables de sesion son:<h1><br></br>
<p>la variable $var: <?echo $var?></p>
<p>la varialbe $var2:<?echo $var2?></p>
<p>
y el identificador de sesion es: <? echo session_id(); ?>
</p>
<?$var2++?>
<p>
<font size=3> volver a la pagina 1 <a href="test1.php">pulsar
aqui</a></font>
<p>
<font size=3> para crear nueva sesion pulsar </font>
</p>
<form method="post" action="./test1.php">
<input type="hidden" name="nueva" value="1">
<input type="submit" value="aqui">
</form>
</p>
</body>
</html>
------------------------------------------------------------------------------
Is this a bug? or am I doing something wrong...
Please need help.
Saludos
Roberto Díaz <rdiazmar@nova.es>
http://www.linuxfocus.org/developer/Roberto