mirror of
https://github.com/yiisoft/yii.git
synced 2026-03-03 06:44:07 +01:00
(Fixes issue 1868)
This commit is contained in:
@@ -128,11 +128,10 @@ CREATE TABLE $tableName
|
||||
*/
|
||||
public function openSession($savePath,$sessionName)
|
||||
{
|
||||
$db=$this->getDbConnection();
|
||||
$db->setActive(true);
|
||||
|
||||
if($this->autoCreateSessionTable)
|
||||
{
|
||||
$db=$this->getDbConnection();
|
||||
$db->setActive(true);
|
||||
$sql="DELETE FROM {$this->sessionTableName} WHERE expire<".time();
|
||||
try
|
||||
{
|
||||
@@ -216,10 +215,8 @@ WHERE expire>$now AND id=:id
|
||||
*/
|
||||
public function gcSession($maxLifetime)
|
||||
{
|
||||
$db=$this->getDbConnection();
|
||||
$db->setActive(true);
|
||||
$sql="DELETE FROM {$this->sessionTableName} WHERE expire<".time();
|
||||
$db->createCommand($sql)->execute();
|
||||
$this->getDbConnection()->createCommand($sql)->execute();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user