Session variables not saving in Windows 2003 Server
Posted: Fri Feb 02, 2007 2:05 pm
feyd | Please use As you would expect, this page prints out "Session: 42" followed by a link to the second test page. Here is the code for that page When I follow the link however, this page only prints out "Session: " -- the variable "level" seems to have been lost. I've checked my php.ini file to ensure that session.auto_start = 0 and now I am out of ideas. Does anyone know if I need to change a setting in Windows or if there is a different bit of code I should use?
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I'm moving a website I built onto a Windows 2003 Server onto which I have installed PHP. However, the session variables are not being saved from page to page. Here is the code from the first test page I built:Code: Select all
<?php
session_start();
session_register("level");
$_SESSION["level"] = 42;
print 'Session: '.$_SESSION["level"];
?>
<br />
<a href="sessiontest.php">session test</a>Code: Select all
<?php
session_start();
print 'Session: '.$_SESSION["level"];
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]