For some reason some browsers are not picking up that a member has just signed in. Below are the steps I am using. I placed a code inside of the member.php file to save the id of the person who has just logged in to a session variable..first i echoed it to verify that it was correct and it was. PHP: echo "$_amember_id"; $_SESSION['cid'] = "$_amember_id"; Then within my restricted side of the site i access the session variable using a code like the one that follows: PHP: $id= $_SESSION['cid']; and placed the following code to make sure no one can acces the page without first logging in: PHP: if($id <= 0 ){ header( "Location: http://foodfitnessfirst.com/subscription/member.php" ); die(); } I dont understand how it could work in some browser and not others when my code is all php(client side) Any ideas? I was just wondering if anyone else has had cross-browser issues and how they fixed it or if anyone could point me in the right direction
The problem can be in url format. By default php use cookies to save session id in browser, and cookie will be set for domain name where you have script that start session. So for example if you set session in www.domain.com it will not be accessible from domain.com and vice versa. so make sure that both scripts that write and read session use the same url format.
sorry it has taken me some time to reply, my clients have 2 urls the main for example would be www.foodfitness.com they have the registered users are redirected to i.foodfitness.com. I could run this issue by them, is there no work around? would you know of a better way to grab the user id for someone who has logged in?
Change this setting in php.ini: session.cookie_domain ".foodfitness.com" Session will work for all subdomains within foodfitness.com