dongyi1111 2011-03-05 12:11
浏览 51

Zend Framework - Zend_Session奇怪的行为

I'm just learning Zend Framework following it's official documentation at the website.

But I'm stucked with a strange behavior of Zend_Session: when user is authenticated, surfing the application pages - everything is ok but if he refresh the browser page quickly (pressing F5 or button in the toolbar) or even if some AJAX php file (that uses session) is requested multiple times, - the session suddenly expires (user is unauthenticated, however cookies expire dates are the same).

Though, I'm not using ACL and MVC structure in my application.

So it works and it is very simple but fails when page is refreshed quickly. Also I don't know why but a separate cookie file is created in /home/user/sessions/ for each page user has visited.

There is a similiar question here zend session expires when refreshed many times but the solution provided doesn't help me :(

  • 写回答

1条回答 默认 最新

  • doushi1912 2012-01-29 10:56
    关注

    In you config, you should set up something like this:

    ;; ========================= Session ===========================================
    resources.session.save_path = APPLICATION_PATH "/../data/session"
    resources.session.name = "SESSION"
    resources.session.gc_maxlifetime =  5184000
    resources.session.gc_probability = 1
    resources.session.gc_divisor = 1000
    resources.session.remember_me_seconds = 5184000
    resources.session.cookie_lifetime = 5184000
    

    That should do it.

    评论

报告相同问题?

悬赏问题

  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler