FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Session variables..
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Session variables.. [message #177922 is a reply to message #177917] Fri, 27 April 2012 08:59 Go to previous messageGo to previous message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma:
Senior Member
Am 27.04.2012 08:33, schrieb karan kumar:
> <?php
> session_start();
> $_SESSION['psid']=111;
> echo $_SESSION['psid'];
> $psid=999;
> echo " ".$_SESSION['psid'];
> ?>
>
> the output is-->1111 1111
>
> but if you reload the page 2nd time then output changes to---> "1111 9999"
>
> and if you write session_destroy() at the end then the output remains unchanged..
> how come local variable psid is overwritten over $_SESSION['psid'].??

The output is unchanged because you always set $_SESSION['psid']. You must first test
if it is set.

The change to "1111 9999" does not happen with the shown code.

/Str.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: const var, self:: or static::
Next Topic: Removing specific array items
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 21:27:37 GMT 2024

Total time taken to generate the page: 0.03666 seconds