Search the Community
Showing results for tags 'session_start'.
Found 1 result
I thought I had this down, but I have a situation that isn't working. I have a page for dealing with schedules called adminSchedules.php and right at the top I put <?php session_start(); .... Then later on I make a xmlHTTPRequest and use the $_SESSION to get & set some session variables. I echoed them back to be sure they were set. Then I go back to the main adminSchedules page and I make another xmlHTTPRequest and when I try to access the session vars I set before, they are not set. I've checked over all the syntax carefully and the error I'm getting in the error_log file is 'variable undefined '_SESSION' . So I'm confused and thought maybe the sessions don't extend to xmlHTTPRequests or what. Can someone explain exactly what the 'scope' of a session is, or what I should be doing differently? I do understand about when you invoke a session var the compiler looks on your computer for the session key and all that, so I don't understand why it's not returning the value when I ask for it. should I be putting a 'session_start()' at the top of every PHP file that I make an xmlHTTPRequest to? Thank you so much for your help