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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.