Jump to content

[SOLVED] sessions - problem passing id


vampke

Recommended Posts

Hi,

 

I have written a script that uses sessions. Everything seems to work just fine here on my local PC (wamp server).

Now I have uploaded everything to my webserver (shared hosting) things are not working as expected. I can't figure out why.

 

After loging in a session is created:

			if($auth_check==1){				
			$_SESSION['auth']=true;
			$_SESSION['timeout']=time()+3600;

			$member=mysql_fetch_array($member_result);
			$_SESSION['id']=$member['id'];	
			$_SESSION['username']=$member['username'];
		}	

 

The script then redirects to index.php which the session values

if(($_SESSION['auth'] && $_SESSION['timeout']>time()))

 

This seems to be working, but if i reload the page or go to another page, the session-id is not passed on, while the username is.

I can't figure out why! Anyone any ideas where I should start to look?

Link to comment
https://forums.phpfreaks.com/topic/122229-solved-sessions-problem-passing-id/
Share on other sites

php should be installed properly, i can't see any important differences between local pc and server config with phpinfo()

 

session_start is at the top of all the pages, as I said: it works locally and the username is passed on at the server, just not the id

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.