I am trying to use PHP session to store a state that is passed through 1 time via the querystring from a referring website. The trouble is locally I can maintain this state in the session scope but it is not working the same on the production server.
Im trying to do this in Wordpress in wp-config.php at the foot of the file:
session_set_cookie_params(0);
session_start();
Starting a session that expires with the browser. Then checking & setting for the querystring param:
if (!isset($_SESSION['isEUStore']) && isset($_GET['store']) && strtolower($_GET['store'])=='eu') $_SESSION['isEUStore']=true;
elseif (!isset($_SESSION['isUSStore']) && isset($_GET['store']) && strtolower($_GET['store'])=='us') $_SESSION['isUSStore']=true;
However, $_SESSION['isEUStore'] or $_SESSION['isUSStore'] returns NULL on any other Wordpress page in the site.
Any advice? Some configuration setting that is different perhaps?
Thanks,