Cookie functionality

will1901

New Member
YetiShare User
Nov 1, 2012
8
0
0
About a week ago I upgraded the script on my site and recently I've had a few people complain about having to login all the time. So I did some investigating and found this:
Code:
class.auth.php [line 290]
//$s = json_encode(array('un' => $un, 'pw' => $pw));
//return setcookie('spf', $s, time() + 60 * 60 * 24 * 30, '/', $Config->authDomain);
I checked and it didn't use to be commented out. Also, all of the functions that read this cookie are still enabled.

Is there a reason this was commented out?
 

will1901

New Member
YetiShare User
Nov 1, 2012
8
0
0
Actually, I lied
Code:
class.auth.php [line 36]
if ($this->attemptCookieLogin())
            return;
Is commented out as well. Restoring both of those restores cookie login functionality.
 

admin2102

New Member
YetiShare User
Jan 15, 2013
85
0
0
Hey thanks for this I have had the Same problem and its been a PITA tried several different sesion settings and never could get them to work but this worked..

Thanks
 

sharelink

New Member
YetiShare User
Wurlie User
Reservo User
Jun 6, 2013
23
0
0
my website code said both codes and cookies dont work fine yet (users off after 30 min login):

Code:
class.auth.php [line 290]
//$s = json_encode(array('un' => $un, 'pw' => $pw));
//return setcookie('spf', $s, time() + 60 * 60 * 24 * 30, '/', $Config->authDomain);
Code:
class.auth.php [line 36]
if ($this->attemptCookieLogin())
            return;
regards
 

ysmods

New Member
Jan 29, 2013
860
1
0
UK
www.ysmods.com
I removed the "//" from the front of those lines mentioned above in class.auth.php and can log in for more than 30 minutes, even after closing and re-opening the browser (including overnight) I am still logged in.

Open class.auth.php and find
Code:
//$s = json_encode(array('un' => $un, 'pw' => $pw));
//return setcookie('spf', $s, time() + 60 * 60 * 24 * 30, '/', $Config->authDomain);
Change to:
Code:
$s = json_encode(array('un' => $un, 'pw' => $pw));
return setcookie('spf', $s, time() + 60 * 60 * 24 * 30, '/', $Config->authDomain);
Find:
Code:
//if ($this->attemptCookieLogin())
        //return;
Change to:
Code:
if ($this->attemptCookieLogin())
            return;
 

sharelink

New Member
YetiShare User
Wurlie User
Reservo User
Jun 6, 2013
23
0
0
thank you YSM, yes, you have right, i change code (i put without //) and now its OK, no un-login the users every 30 minutes

regards