問題描述
我收到用戶的報告和投訴,稱他們將使用屏幕并在下一次請求時立即返回登錄屏幕.它不會一直發生,而是隨機發生.
I'm having reports and complaints from my user that they will be using a screen and get kicked back to the login screen immediately on their next request. It doesn't happen all the time but randomly.
我正在使用 CakePHP 和 Auth 組件,除此問題外,它們似乎運行良好
I am using CakePHP and the Auth component, which seem to work well other than this issue
我曾在 Cake 論壇上收到一些反饋,說這有時是由重置會話的 404 請求引起的,即如果您的圖像鏈接損壞或網站圖標文件丟失.我打開了 firebug 并且沒有失敗的請求,所以我排除了這種可能性,但用戶偶爾會退出.這似乎跨瀏覽器和操作系統都會發生.
I got some feedback on the Cake forums once that this is sometimes caused by a 404 request that resets the session, i.e. if you have a broken image link or a missing favicon file. I have firebug open and there are no failed requests, so I ruled this out as a possibility, but the user is getting sporadically logged out. This seems to occur across browsers and operating systems.
以下是我的配置設置摘要:安全級別 = 高Session.timeout = 1200//這意味著我的實際超時應該是 12,000 秒Session.save = php
Below is a summary of my config settings: Security.level = high Session.timeout = 1200 // this means my actual timeout should be 12,000 seconds Session.save = php
我真的不知道是什么導致了這個問題......
I am really at a loss as to what is causing this issue...
推薦答案
我的安全設置為高也有問題.當您將其設置為高時,它會根據每個請求重新生成會話:如果 'Security.level' 設置為 'high',CakePHP 會話 ID 也會在請求之間重新生成."
I have also had a problem with my security set to high. When you have it set to high it regenerates the session on every request: "CakePHP session IDs are also regenerated between requests if 'Security.level' is set to 'high'."
我在跨瀏覽器時也遇到了這個問題,所以我知道這不是最好的解決方案,但我只是將安全設置更改為中等,并更改了我的會話超時以反映該設置,此后沒有出現任何問題.
I had this problem cross-browser as well, so I know its not the best solution but I just changed the security setting to medium, and changed my session timeout to reflect that setting and have not had any problems since.
這篇關于CakePHP 會話/身份驗證間歇性注銷的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!