Re: [PHP4BETA] session_destroy returns FALSE :???????
| From: | Roberto Diaz | Date: | Sun, 21 Nov 1999 21:56:59 +0000 |
| Subject: | Re: [PHP4BETA] session_destroy returns FALSE :??????? | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-6622@lists.php.net to get a copy of this message | ||
Now with phpb3 all seems to be working correctly..
I find the safest sequence to destroy a session is:
session_start() // we start the session we want to destroy
session_unset() // better to clean up
session_destroy() // now it works!
And the session is caput... ;)
> Hello,
> I've tested your code with beta3-RC5, on Linux 6.1.
> The results are all the same as you.
> I replaces the session_start() such as
> <?
> session_start();
> if(isset($nueva) && $nueva==1){
> $sid = session_destroy();
> if($sid==FALSE) printf "session_destroy() returns FALSE";
> }
> ....
> ?>
> still printing "session_destroy() returns FALSE".
> However, the session file in /tmp/ removed correctly.
> Anyway, I think it's a bug !
> I've checked the answers on php4beta mailing lists, but could not see
> any reasonable answers.
> Do you have any answers from othes ?
> Please let me know if you get any answers or reasons.
> Thanks.
>
>
>
>
> Roberto Diaz wrote:
>
> > 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
> >
> > --
> > PHP 4.0 Beta Mailing List
> > <http://www.php.net/version4/>
> > To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net
> > For additional commands, e-mail: php4beta-help@lists.php.net
> > To contact the list administrators, e-mail: php4beta-admin@lists.php.net
>
Saludos
Roberto Díaz <rdiazmar@nova.es>
http://www.linuxfocus.org/developer/Roberto