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

CakePHP 的身份驗證超時問題

Auth timeout problems with CakePHP(CakePHP 的身份驗證超時問題)
本文介紹了CakePHP 的身份驗證超時問題的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

這真的讓我很煩惱.已經好多年了.無論我用 core.php 還是 php.ini 做什么,我的登錄都會在大約一個小時后超時——通常是.一些相同代碼和配置的部署在相當長的時間后超時.

This is really bugging me. Has been for years. No matter what I do with core.php or php.ini, my logins timeout after about an hour - usually. Some deployments of identical code and configuration timeout after a respectable amount of time.

這是我目前在一個網站上的內容 - 大約一個小時后超時:

This is what I have at the moment on one site - timed out after about an hour:

session.gc_divisor  1000
session.gc_maxlifetime  86400
session.gc_probability  1

Configure::write('Session.timeout', '28800');
Configure::write('Session.checkAgent', false);
Configure::write('Security.level', 'medium');

另一個 - 持續了一夜:

And another - lasted all night:

session.gc_divisor  100
session.gc_maxlifetime  14400
session.gc_probability  0

Configure::write('Session.timeout', '315360000');
Configure::write('Session.checkAgent', false);
Configure::write('Security.level', 'medium');

現在,在您興奮地說嗯,答案就在 Session.timeout 值中"之前,讓我告訴您,該站點通常會在大約 20 分鐘后超時!

Now, before you get excited and say, "Well, the answer is there in the Session.timeout value", let me tell you that this site usually times out after about twenty minutes!

推薦答案

我在共享主機上讀到過,其他應用程序可以通過清除 php 定義的會話目錄來重置會話.Rowlf 在他的回答中提到了這一點.

Somewhere I read that on shared hosting, other applications can reset the session by clearing the php-defined session directory. This was alluded to by Rowlf in his answer.

CakePHP 提供了配置會話處理方式的選項.在 core.php 中,我將其更改為 'cake'(默認為 'php'):

CakePHP offers the option to configure the way sessions are handled. In core.php I changed this to 'cake' (by default it is 'php'):

/**
 * The preferred session handling method. Valid values:
 *
 * 'php'            Uses settings defined in your php.ini.
 * 'cake'       Saves session files in CakePHP's /tmp directory.
 * 'database'   Uses CakePHP's database sessions.
 */
Configure::write('Session.save', 'cake');

我還確保會話超時和相應的 php.ini 值相同:

I also ensured that the session timeout and the corresponding php.ini values are the same:

/**
 * Session time out time (in seconds).
 * Actual value depends on 'Security.level' setting.
 */
Configure::write('Session.timeout', '86400');

到目前為止,系統還沒有退出.

So far, the system hasn't logged out.

這篇關于CakePHP 的身份驗證超時問題的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

Cannot use #39;Object as class name as it is reserved Cake 2.2.x(不能使用 Object 作為類名,因為它是保留的 Cake 2.2.x)
Session is lost after an OAuth redirect(OAuth 重定向后會話丟失)
Pagination Sort in Cakephp 3.x(Cakephp 3.x 中的分頁排序)
CakePHP Shared core for multiple apps(CakePHP 多個應用程序的共享核心)
Login [ Auth-gt;identify() ] always false on CakePHP 3(在 CakePHP 3 上登錄 [ Auth-identify() ] 始終為 false)
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 87 bytes)(致命錯誤:允許的內存大小為 134217728 字節已用盡(嘗試分配 87 字節))
主站蜘蛛池模板: 欧美一区二区三区在线 | 久久精品国产99国产精品 | 国产精品日韩欧美 | 日韩免费av一区二区 | 中文字幕国产视频 | 成人片免费看 | 国产网站在线免费观看 | 欧美视频一区 | h视频免费观看 | 欧美激情视频一区二区三区在线播放 | 国产精品成人久久久久a级 久久蜜桃av一区二区天堂 | 中文字幕精品一区久久久久 | 美女黄18岁以下禁止观看 | 久久亚洲国产 | 亚洲午夜精品一区二区三区 | 九九在线 | 欧美精品久久久久久久久久 | 99热这里都是精品 | 欧美视频三区 | 久久精品国产一区二区三区 | 久久成人精品视频 | 国产91视频免费 | 在线免费av观看 | 日韩手机在线视频 | 久久久久国产一区二区 | 精品1区| 亚洲成人一区二区 | 怡红院免费的全部视频 | 先锋影音资源网站 | 欧美日韩国产综合在线 | 国产蜜臀97一区二区三区 | 草久久| 国产婷婷精品av在线 | 爱操影视 | 视频一区二区中文字幕 | 丁香色婷婷 | 亚洲精品乱码久久久久久9色 | 日韩欧美在线播放 | 欧美精品二区 | 国产日韩一区二区三免费高清 | 成人精品鲁一区一区二区 |