追踪神秘的会话结束错误
我正在使用 Codeigniter/PyroCMS,它使用 ion_auth。
我的会议内容设置为两个小时。我正在使用数据库会话。
有时,某个地方有一个小精灵会在 n 分钟后启动会话。它是非常随机的,因此hard不可能可靠地重现。
我已将日志条目添加到 Session 类(特别是 sess_destroy),但这仅记录被销毁的会话,这是我已经知道的。
我尝试将 debug_backtrace() 添加到所述日志条目中,但这不会与代码一起抖动(它不会被记录/它会在 !session 重定向之前将其吐到屏幕上一瞬间)。
有没有好的/正确的方法来追踪这个问题?
谢谢伪装。
更新:我在 Session.php 中添加了更多日志条目,结果发现数据库会话被错误地删除/覆盖。哇?
I'm using Codeigniter/PyroCMS which uses ion_auth.
I have my session stuff set for two hours. I'm using db sessions.
There is a gremlin somewhere that is booting the session after n minutes, sometimes. It is very random, and as such is hard impossible to reliably reproduce.
I've added log entries to the Session class (specifically sess_destroy) but that merely logs the session being destroyed, which I already knew.
I tried to add a debug_backtrace() into said log entry, but that aint jiving with teh codes (it doesn't get logged/it spits it onto the screen for a split second before the !session redirect).
Is there a good/proper way to track this down?
Thanks guise.
update: I added a few more log entries in Session.php Turns out the db session is being deleted/overwritten incorrectly. WHAI?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这似乎是一个很常见的问题。我已经使用过(并且很高兴地接受作为推荐)
Codeigniter 的 Native 会话(底部有一个下载链接)
但是,由于它是一个旧库,您可以必须进行一些黑客攻击。您可以在库的论坛中检查这些简单的技巧,
只需将此文件放入codeigniter的库目录并查看是否可以解决您的问题。请反馈。
This seems a problem quite common. I have used (and happily accepted as recommendation)
Codeigniter's Native session (there is a download link at the bottom)
BUT, due that it is an old library you MUST made some hacks. You can check those simple hacks in the library's forum
Just drop this file in codeigniter's library directory and see if resolve your problem. Please feedback.
听起来您的会话 cookie 已提前过期。首先检查配置文件中与会话相关的内容的设置。即 $config['sess_expiration'] 值,默认为 7200。即 2 小时。
然后检查你的 php.ini,我相信它默认为 3600。(1 小时)
否则,我想说,如果你的代码位于 unix 系统上,请
尝试可能会向会话写入 NULL 或空值。可能您在任何地方都没有 sess_destroy,但您可能有一些达到 unset($_SESSION) 效果的东西。
希望这有帮助。
Sounds like your session cookie is prematurely expiring. Start by checking the settings in your config file for your session related stuff. Namely the $config['sess_expiration'] value, which defaults to 7200. Which is 2 hours.
Then check your php.ini, which I believe defaults to 3600. (1 hr)
Otherwise, I would say that if your code is on a unix system, try a
The other thing you might want to look for is anyplace that is attempting to possibly write NULLs or empty values to the session. It's possible that you don't have a sess_destroy anywhere, but that you could have something to the effect of unset($_SESSION).
Hope this helps.
这似乎是服务器和resolve.conf 映射内容不正确的问题。
It appears to have been an issue with the server and resolve.conf mapping things incorrectly.