Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session variables lost between pages

Status
Not open for further replies.

joshmaker

Programmer
Feb 2, 2007
4
US
I'm moving a website to a Windows 2003 Server, onto which I have installed PHP. I can create session variables, however, they are not being saved from one page to another. Is there a setting I have to turn on to get IIS to use session variables?
 
I've never had an issue using sessions with PHP before, and code that worked on my old server no longer works on my current one. The code I'm testing right now is extremely simple, and yet it still doesn't work:

page 1:
<?php
session_start();

$_SESSION["level"] = 42;
print 'Session: '.$_SESSION["level"];
?>

page 2:
<?php
session_start();

print 'Session: '.$_SESSION["level"];
?>

The first page prints out "Session: 42", the second one just prints "Session
 
OK, I think the problem is fixed. I created a new "sessions" folder, and then fiddled with the folder permissions until it worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top