久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

盡管會話超時設置為至少 1 天,但 Yii 用戶仍會在

Yii users being logged out after 15-30 minutes despite session timeouts being set to at least 1 day(盡管會話超時設置為至少 1 天,但 Yii 用戶仍會在 15-30 分鐘后注銷)
本文介紹了盡管會話超時設置為至少 1 天,但 Yii 用戶仍會在 15-30 分鐘后注銷的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我在下面包含了 Yii 配置文件的相關部分:

I've included the relevent parts of our Yii config file below:

return array(
...
    'components'=>array(
        'session' => array(
            'timeout' => 86400,
        ),
        'user'=>array(
            'allowAutoLogin' => true,
            'autoRenewCookie' => true,
            'authTimeout' => 31557600,
        ),
    ...
    ),
...
);

我也進入了 php.ini 并設置了 session.gc_maxlifetime = 86400 但這仍然沒有解決問題.

I have also been into php.ini and set session.gc_maxlifetime = 86400 but this still hasn't fixed the problem.

目前,我完全不知道還有什么可能導致它超時并在大約 15-30 分鐘不活動后將用戶注銷.理想情況下,用戶應該保持登錄狀態至少一天不活動(并且除了關閉瀏覽器窗口,瀏覽器首選項允許).

Currently, Im absolutely at a loss as to what else could be causing it to timeout and log the user out after roughly 15-30 minutes of inactivity. Ideally users should remain logged in for at least a day of inactivity (and beyond closing the browser window, browser preferences allowing).

我已經搜索了 google、Yii 和堆棧溢出,但找不到任何我忽略的東西……但顯然我忽略了一些東西.如果有人可以幫助我,我將不勝感激.

I've trawled google, Yii and stack overflow and just can't find anything that I'm overlooking... but clearly I am overlooking something. If anyone can help me out I'd be very grateful.

我們用來登錄用戶的典型代碼示例被請求,包含在下面:

A sample of typical code that we are using to log in the users was requested and is included below:

$identity = new UserIdentity('facebook', $id, $user->name, $user->email);
$loggedIn = Yii::app()->user->login($identity);
$this->subscriptionChecker->updateCurrentUserSubscribed();

這是很典型的任何時候 Yii::app()->user->login() 被調用

This is pretty typical of any time that Yii::app()->user->login() is called

在 Chrome 中,以下是我為該網站準備的 cookie 及其到期時間(在清除所有 cookie 并登錄后):

From Chrome, here are the cookies I have for the site and their expiries (after clearing all cookies and just logging in):

PHPSESSID expires When the browsing session ends

// I'm informed these are set by google analytics  
__utma created Friday, 12 October 2012 14:05:31 expires Sunday, 12 October 2014 14:05:31

__utmb created Friday 12 October 2012 14:05:31 expires Friday 12 October 2012 14:35:31,

__utmc created Friday, 12 October 2012 14:05:31 expires When the browsing session ends

__utmz created Friday 12 October 2012 14:05:31 expires Saturday 13 April 2013 02:05:31  
// end google analytics

推薦答案

http://www.yiiframework.com/doc/api/1.1/CWebUser#login-detail

感謝 Arfeen 的幫助,他為我指明了正確的方向,除非您設置了 Yii::app()->user->login() 的第二個參數,否則結果是Yii 不會使用持久性 cookie,因為第二個參數默認為 0.這個默認的 0 值會覆蓋您可能設置的任何其他超時值.

Thanks to help from Arfeen who pointed me in the right direction, unless you set the second parameter of Yii::app()->user->login() it turns out that Yii will not use a persistent cookie, as the second parameter defaults to 0. This default 0-value overrides anything else you might have set to do with timeouts.

這篇關于盡管會話超時設置為至少 1 天,但 Yii 用戶仍會在 15-30 分鐘后注銷的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數組自動填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 青春草91| 久久精品久久久久久 | 天堂色网 | 91精品国产综合久久久久久蜜臀 | 天天天天天天天干 | 亚洲第一av网站 | 玖玖视频国产 | 亚洲成人av | 亚洲精品乱码久久久久久按摩观 | 亚洲欧美综合精品久久成人 | 亚洲黄色网址视频 | 国产 欧美 日韩 一区 | 天天综合网天天综合色 | 亚洲免费视频在线观看 | 天天夜干 | 国产99久久精品一区二区永久免费 | 天堂中文av | 欧美国产精品一区二区三区 | 热re99久久精品国99热观看 | 亚洲精品国产a久久久久久 中文字幕一区二区三区四区五区 | 久久区二区 | 2一3sex性hd| 午夜精品一区二区三区免费视频 | 日韩综合在线播放 | www.99精品| 欧美国产精品 | 亚洲国产aⅴ精品一区二区 免费观看av | 久久777| 黄色三级免费网站 | 一级黄色片免费 | 成人久久久久久久久 | 99视频精品| 色黄爽 | 成人免费视频在线观看 | 中文字幕国产视频 | 美女亚洲一区 | 欧美一级在线免费 | 国产精品一区二 | 91精品国产91久久久久久吃药 | av成人在线观看 | 日韩精品 电影一区 亚洲 |