Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #5758

Re: Session variables..

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.straub-nv.de!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!not-for-mail
From "M. Strobel" <sorry_no_mail_here@nowhere.dee>
Newsgroups comp.lang.php
Subject Re: Session variables..
Date Fri, 27 Apr 2012 10:52:07 +0200
Lines 30
Message-ID <9vv51oF2nnU1@mid.uni-berlin.de> (permalink)
References <22074986.120.1335432844876.JavaMail.geo-discussion-forums@pbgg7> <9vsjfdFj9mU1@mid.uni-berlin.de> <19098981.177.1335508561294.JavaMail.geo-discussion-forums@pblz5>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de wfsTtI+G4+1sJ2EN2FHLnA5N6DqhIvR2dXn6brs3/OF7z0sbY=
User-Agent Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20
In-Reply-To <19098981.177.1335508561294.JavaMail.geo-discussion-forums@pblz5>
Xref csiph.com comp.lang.php:5758

Show key headers only | View raw


Am 27.04.2012 08:36, schrieb karan kumar:
> PLZ take a look and Provide for a solutionn 
> 
> 
> code is....--> 
> 
> 
> <?php 
> session_start(); 
> $_SESSION['psid']=1111; 
> echo $_SESSION['psid']; 
> $psid=9999; 
> 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'].?? 

to session_destroy():

you will have your session variables until the end of script. On the next request
they will be gone. The session id remains the same, but the session data is gone.

I find it a bit strange, this function cleans up after you.

/Str.

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Session variables.. xs2karan3190@gmail.com - 2012-04-26 02:34 -0700
  Re: Session variables.. "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-04-26 11:39 +0200
    Re: Session variables.. karan kumar <xs2karan3190@gmail.com> - 2012-04-26 23:33 -0700
      Re: Session variables.. "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-04-27 10:59 +0200
      Re: Session variables.. Jerry Stuckle <jstucklex@attglobal.net> - 2012-04-27 06:30 -0400
        Re: Session variables.. karan kumar <xs2karan3190@gmail.com> - 2012-05-02 21:19 -0700
          Re: Session variables.. Jerry Stuckle <jstucklex@attglobal.net> - 2012-05-03 08:11 -0400
            Re: Session variables.. karan kumar <xs2karan3190@gmail.com> - 2012-05-03 23:19 -0700
              Re: Session variables.. Jerry Stuckle <jstucklex@attglobal.net> - 2012-05-04 07:36 -0400
    Re: Session variables.. karan kumar <xs2karan3190@gmail.com> - 2012-04-26 23:36 -0700
      Re: Session variables.. "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-04-27 10:52 +0200
  Re: Session variables.. "Olaf S." <thesys@gmx.de> - 2012-04-26 14:10 +0200
    Re: Session variables.. "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-04-26 15:12 +0200
      Re: Session variables.. Jerry Stuckle <jstucklex@attglobal.net> - 2012-04-26 20:35 -0400
  Re: Session variables.. Scott Johnson <noonehome@chalupasworld.com> - 2012-04-26 05:36 -0700
  Re: Session variables.. Jerry Stuckle <jstucklex@attglobal.net> - 2012-04-26 20:37 -0400

csiph-web