Session Variables Set Twice? Crazy behavior!
-
20th April 2011
4:18 pm
StevenI’m experiencing a problem with WordPress and was someone may be able to offer some insight. ‘register_globals’ is turned Off in my php.ini.
In my header.php
session_start(); print_r($_SESSION); global $myVar; $myVar = time();
In my footer.php
global $myVar; $_SESSION['key'] = $myVar; print_r($_SESSION);
When I do this, the output in the footer shows me that the the session variable ‘key’ was correctly set to my new time value ($myVar). However, when I reload the page, the header output will show that the same session variable ‘key’ is now 2–5 seconds faster than it should be. It is like the header is being called again after the page has loaded.
It’s Crazy!
- The topic ‘Session Variables Set Twice? Crazy behavior!’ is closed to new replies.