note 62433 added to ref.session

From: Date: Tue, 28 Feb 2006 17:10:29 +0000
Subject: note 62433 added to ref.session
Groups: php.notes 
Request: Send a blank email to php-notes+get-104565@lists.php.net to get a copy of this message
Important note that it just took me the better part of two hours to figure out: Even if you're using session_write_close(), calling exit after a redirect will eat your session variables. I had the following: Source of register.php: <?PHP // Some files included here // Process our posted form data $result = processPost(); if ($result) { redirect('success.php'); } else { redirect('failure.php'); } exit; ?> processPost() was setting a couple of session variables, including an error message, but neither results page was seeing those variables. I removed the exit call from the register page, and all works fine. /bonks self ---- Server IP: 64.71.164.2 Probable Submitter: 208.18.162.201 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/ref.session.php Edit -- http://master.php.net/note/edit/62433 Del: integrated -- http://master.php.net/note/delete/62433/integrated Del: useless -- http://master.php.net/note/delete/62433/useless Del: bad code -- http://master.php.net/note/delete/62433/bad+code Del: spam -- http://master.php.net/note/delete/62433/spam Del: non-english -- http://master.php.net/note/delete/62433/non-english Del: in docs -- http://master.php.net/note/delete/62433/in+docs Del: other reasons-- http://master.php.net/note/delete/62433 Reject -- http://master.php.net/note/reject/62433 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#104565) next »