I've researched this problem for at least 6 hours, maybe someone here can help...
I have a login form that starts a session then redirects to a member's page. The code works flawlessly testing on my local host. HOWEVER, when I test the exact same code on a remote server, the session is successfully started, but does not persist to the member's page. Login is working perfectly on the remote server, but the session dies before the member's page.
Both servers are IIS6 with PHP 5.2.5. My phpinfo pages show that both ini files have exactly the same session settings, except for session.save_path. (note that on the remote server, the path is outside my url domain; we host 3 urls on that server)
Here's how I set SESS_MEMBER_ID on the login page:
//Login Successful
session_regenerate_id();
$member=mysql_fetch_assoc($result);
$_SESSION['SESS_MEMBER_ID']=$member['member_id'];
session_write_close();
header("location: member-index.php");
exit();
And here's how I test for it on the member's page:
if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID'])=='')) {
On the remote server, the session definately starts, and the member id is definately set; I've successfully output both values using echo. But, the member id does not persist over to the member's page.
It seems to be a server setting issue I am not familiar with. Any light you could shed on this issue would be greatly appreciated. I stumped.
session doesn't persist on remote server
Moderator: General Moderators
-
quietearth
- Forum Newbie
- Posts: 1
- Joined: Thu Mar 27, 2008 2:48 am