thefollower Posted November 8, 2007 Share Posted November 8, 2007 How do sessions work cos mine isnt working i got this: on a different page i have : $_SESSION['referer'] = '1'; then: if ($_SESSION['referer'] == '1'){ include ("include.php"); } but when i echo session it is blank =/ what did i do wrong.. i got many other sessions on the go so it should work.. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 8, 2007 Share Posted November 8, 2007 gotta have sesssion_start(); on top of each page BEFORE ANY OUTPUT. if you do'nt your session data gets blanked usually, or it happens with time as they aren't refreshing a sessioned page. Quote Link to comment Share on other sites More sharing options...
thefollower Posted November 8, 2007 Author Share Posted November 8, 2007 i do i have: include("londonpagesinclude.php"); $_SESSION['referer'] = '1'; then similiar thing on the other page also... plus i have to have session start cos the page logs the user out otherwise . Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 8, 2007 Share Posted November 8, 2007 I don't see session_start(); Quote Link to comment Share on other sites More sharing options...
thefollower Posted November 8, 2007 Author Share Posted November 8, 2007 its in the include thats why. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 8, 2007 Share Posted November 8, 2007 do print_r($_SESSIONS) and you can see what you got on each page Quote Link to comment Share on other sites More sharing options...
revraz Posted November 8, 2007 Share Posted November 8, 2007 Every page doesn't mean in Includes. Enter the code on every page you want Sessions to work on. its in the include thats why. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.