note 13536 added to function.session-start.php

From: Date: Wed, 20 Jun 2001 21:47:41 +0000
Subject: note 13536 added to function.session-start.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-14503@lists.php.net to get a copy of this message
i have a problem with cache when dealing with sessions. here is my code: <?php header ("Cache-Control: no-cache, must-revalidate"); header ("Pragma: no-cache"); if(isset($HTTP_GET_VARS["sid"])) session_id($HTTP_GET_VARS["sid"]); session_start(); echo session_id(); if(!session_destroy()) echo "\n failed destroying session!\n "; echo session_id(); ---EOF and when i go for it (test.php), it gies me a new session id but fails to destroy the session (thats another problem!). then when i give its SID (test.php?sid=123), it set this SID for the sesion correctly and fails to destroy the session. the cache problem is when i got back without SID (test.php) its give me and error about my vars that i had before which point now on a lines with the header function: Parse error: parse error, expecting T_VARIABLE' or '$'' in F:\apache\ht\htlocal\test.php on line 3 and if i refresh from the browser, it has my custom SID set back which i never specified (i refresh test.php and not test.php?sid=123). i guess it caches something in memory or maybe the session is never destroyed because i never get a new SID if i send none, i always get te same one. thats a weird reaction!! http://www.php.net/manual/en/function.session-start.php

« previous php.notes (#14503) next »