note 59269 deleted from function.session-start by bjori

From: Date: Sun, 16 Apr 2006 00:35:19 +0000
Subject: note 59269 deleted from function.session-start by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-108228@lists.php.net to get a copy of this message
Note Submitter: gocaballero at hotmail dot com ---- in responce to gadgetguy03 at lycos dot com SESSION LOST ON HEADER REDIRECT (CGI on IIS 5.0) and ma at technoprint dot ch I have the same server setup. I fought this for days. Then I realized that If I create the session with session_start() without setting any session variables on the page before I needed to set session variables and then do a redirect, everything magically worked. It was only when there was no session in existence that the following code would not work as expected. /***** sess1.php *****/ session_start(); $_SESSION["key1"] = "testvalue"; session_write_close() header("Location: sess2.php"); I've seen several post regarding this same issue, so I hope this is helpful.

« previous php.notes (#108228) next »