RE: Sessions

From: Date: Sun, 27 Aug 2000 14:15:12 +0000
Subject: RE: Sessions
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-2183@lists.php.net to get a copy of this message
Nice day here in the UK thanks but still having major problems with sessions. Please note that I can maintain the value of my session variables between web pages. However, the problem I have is that I can't kill (destroy) the session once I'm finished with it. If I issue a "session_destroy()" command on the same web page that first created the session then the contents of the session file on the server is emptied (file size 0 bytes). However, if I attempt to destroy the session on another page then the session file isn't emptied and still contains the variable values. Using "session_unset" before the "session_destroy()" command doesn't help. I tried your example code below and it DIDN'T print the SID. Whenever and however I tried to print SID it never returns a value. However, using session_id() instead works fine and produces the same results as your script. Is this a cause of concern? Any help on killing sessions with PHP (I'm running the latest version - binary downloaded from PHP website) will be greatly appreciated. I'm running on NT 2000 and Apache. Thanks James -----Original Message----- From: 1193-639-1 [mailto:ks@ksweb.de] Sent: 27 August 2000 08:21 To: James Duncan Cc: php-windows@lists.php.net; daniel@php4win.de Subject: AW: Sessions re_Hi :-) hope it's a nice morning in uk I've solved the session - problem (had set an directory to session.save_path and it seems that php does't like that, even it exists) session1.php: <? session_register("x")."<br>"; $x=12; echo SID."<br>"; $s=SID; echo "<a href=session2.php?$s>go to 2</a>"; ?> outputs: PHPSESSID=eadcec17244bf2c647159e83c2421eb1 go to 2 session2.php <? session_start(); echo SID."<br>"; echo session_is_registered("x")."<br>"; echo $x."<br>"; ?> outputs: PHPSESSID=eadcec17244bf2c647159e83c2421eb1 1 12 "The <?=SID?> is not necessary, if --enable-trans-sid was used to compile PHP. " (from php.net) // the <?=SID?> is wrong!! to send the SID via get in the URI is 'ugly' and perhaps Daniel Beulshausen [daniel@php4win.de] is able to fix that ?? I think at the moment it only works via URI cu Klaus Schmidt Bad Schwartau, Germany

« previous php.windows (#2183) next »