blackrobe
(Bilal Khartabil)
March 2, 2014, 5:14pm
1
Hey there,
I’m facing a very annoying issue here. I’m using the yii-app extension as a template for my web application. On a localhost for development, everything worked fine. After deployment however, an authenticated user only stays signed in for a few seconds, or after a few clicks around the user is logged out automatically.
Any ideas what might be the reason for this?
Thanks,
boaz
(Boaz Rymland)
March 3, 2014, 7:29am
2
I advise to better debug the situation:
[size=2]use developer toolbar/firebug to check for PHP session cookie[/size]
[size=2]check server side php log files[/size]
[size=2]check yii application log files[/size]
an idea:
php configuration on server side dictates this minimal session lifetime?
blackrobe
(Bilal Khartabil)
March 5, 2014, 10:25am
3
I found what was causing the problem. Apparently, on the main domain I was doing the following:
if (isset($_SERVER['HTTP_COOKIE'])) {
$cookies = explode(';', $_SERVER['HTTP_COOKIE']);
foreach ($cookies as $cookie) {
$parts = explode('=', $cookie);
$name = trim($parts[0]);
setcookie($name, '', time() - 1000);
setcookie($name, '', time() - 1000, '/');
}
}
This resulted in the resetting of cookies on the Yii application I have installed on a sub folder of this domain.
Is there a way to keep that yet protect my sub yii application from it?
Thanks a lot for your help