AW: Sessions

From: Date: Sun, 27 Aug 2000 18:09:09 +0000
Subject: AW: Sessions
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-2186@lists.php.net to get a copy of this message
yes, it the same here on WIN98,Apache 1.3.12, PHP4.0.2dev (based on the actual file from php.net) I tried the following and the Server ist clean, no 'orphan'-session-files hope it works <? session_start(); $id=session_id(); // I didn't try so set this variables 'behind' the $path=session_save_path(); // _unset() and _destroy ...up2u $file = $path . "sess_" . $id; echo $file."<br>"; @session_destroy(); // shows a warning without that '@' :-)) an doesn't destroy the file // but without that line the unlink() don't works. // so it seems that any important internal link/index is destroyed! echo unlink($file); // success ?> outputs: C:\usr\htdocs\ksweb\sessions\sess_6a8f3ec2809f5fa3b2a0975ab3191629 1 cu Klaus p.s.: here a important text from php.net.manual: (hope you know that) theo@alldarlings.com 09-Jan-2000 01:54 <PRE> What session_start does is looks for an existing session, and if none exists, it creates a new one. What it also does (that wasn't fully eplained above by the statement "initializes variables" is looks for any session variables, and sets them globally on the page that start got called from. If you have any variables already set (say from a get/post from the previous page) they will get overwritten. Also, changing a variable on a page will not update its session counterpart. Also, note that any call to session_register will automatically call session_start (and therefore pull all session variables and set their local counterparts.) If I wasn't so lazy, I'd upload an example of what I mean. </PRE>

« previous php.windows (#2186) next »