Php sessions

Soldato
Joined
24 Nov 2002
Posts
16,378
Location
38.744281°N 104.846806°W
I have php/mysql on my pc and on this a script using sessions works fine. When one goes "back" it takes you back to the logged in page, rather than the login page....

However on my server, if you use the back button (or follow a hyperlink) the "session" appears to be lost and you have to login again..... In fact, on rechecking, it doesn't appear to log the session at all and navigating to another page (that checks to see if the user is logged in) throws a wobbly saying the user isn't logged in.

I don't understand why seeing as it works locally....

I am guessing this is something to do with php.ini but can't think what. Also I'm not exactly sure I have access to my servers php.ini so is there a way to change/stop this in the php itself or with .htaccess?

Cheers...
 
Last edited:
Had another play and it definately works on my localhost...

Going to try it on the server at work as it still doesn't work on my webspace.
 
Written a bit extra that enables the user to tick a box to be remembered (that writes a cookie) and this way they stay logged in...

However surely it should work on just sessions seeing as it does on the localhost?
 
Last edited:
nomore said:
Make sure you put the start_session() funtion right at the top of each page.

Would that a make a difference though, between the two copies of the site? (local/remote)

(checking now)

Edit. session_start(); is at the top of every page..
 
Back
Top Bottom