PHP Session variables not passing across pages
Posted
by mitch
on Stack Overflow
See other posts from Stack Overflow
or by mitch
Published on 2010-03-21T16:42:32Z
Indexed on
2010/03/21
16:51 UTC
Read the original article
Hit count: 515
Common problem, but I'm stumped. Session variables are passing across pages on my local (localhost) deployment, but not on my (www) host. I use a common includes file for each page with this code:
$sessionDomain = "/";
@ini_set("session.cookie_path",$sessionDomain);
$sessionName = "ccSID".md5('/store/');
session_name($sessionName);
session_start();
I confirmed that the session ID cookie (ccSIDxxxxx...) remains the same across pages in my browser, but session variables don't seem to hold up when changing to a page in a different directory.
© Stack Overflow or respective owner