Sessions not sticking linux server
Posted
by
Jacob Windsor
on Stack Overflow
See other posts from Stack Overflow
or by Jacob Windsor
Published on 2012-06-22T22:12:27Z
Indexed on
2012/06/23
3:16 UTC
Read the original article
Hit count: 150
I have just moved the dev site over to my linux server for production but the sessions don't seem to be sticking for very long. I am guessing it is the server settings and not the php because it does the same thing with the plesk panel. Whenever a script is executed the sessions seems to get unset. I see nothing in the error log so not sure what it is. It all worked fine on wamp. Anyway I uploaded the php.ini file which was in the wamp server as it had all the settings i needed and all was working on localhost. Not sure what the problem is and this is the final thing that I have to sort out before going into production. And just too add the sessions are being started as they last for a little bit just don't stick around long.
Here is the relevent part of my login script just in case there is something wrong with the code:
// if login is ok then we add a cookie
if($flag == 0) {
$pass = htmlspecialchars(mysql_real_escape_string($_POST['pass']));
$username = htmlspecialchars(mysql_real_escape_string($_POST['username']));
$_SESSION['username']=$username;
$_SESSION['password']=$pass;
© Stack Overflow or respective owner