note 62486 modified in ref.session by danbrown

From: Date: Sun, 20 Jul 2008 18:19:46 +0000
Subject: note 62486 modified in ref.session by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-142217@lists.php.net to get a copy of this message
I just spent a lot of time trying to figure out why my session variables were not available after I seemed to have set them(could echo after setting). I use the same script for several different functions, so the user may reload the page for other purposes. Someone else posted the use of session_write_close(); before a Location redirect. This also worked in put this after I set the session variables the variables are available when the page reloads for another function. <?php $_SESSION['guid'] = $guid; $_SESSION['userdata'] = $response; session_write_close(); ?> --was-- I just spent a lot of time trying to figure out why my session variables were not available after I seemed to have set them(could echo after setting). I use the same script for several different functions, so the user may reload the page for other purposes. Someone else posted the use of session_write_close(); before a Location redirect. This also worked in put this after I set the session variables the variables are available when the page reloads for another function. $_SESSION['guid'] = $guid; $_SESSION['userdata'] = $response; session_write_close(); http://php.net/manual/en/ref.session.php

« previous php.notes (#142217) next »