douzhuo6931 2009-06-23 22:21
浏览 45

Symfony sfGuardPlugin会话不一致

Ok I have several modules in my application in symfony. I have only one module that is secure: on. I also have a layout.php that on top includes a tabbed menu to display links for each module in my application. This menu also has a part where the user is displayed link to 'sign in' if user is not logged in and 'log out' if user is logged in.

When I attempt to visit the module that is secure: on I am forwarded to the sign in page. I can log in fine and the cookie is created. If I go to any other module the menu displays the 'log out' link.

Lets say I close the browser (cookie is set to expire in 15 days) and open up browser again and i go to the homepage module. I should be logged in but the menu displays 'sign in' instead (thinking no user is logged in). I try to visit the secure: on module and then when page reloads the menu displays the 'log out' link because it now reads the cookie.

What I found out is that if a cookie is set and I close browser and reopen it at the homepage there are two cookies, one 'sfRemember', and second 'symfony'. After I visit the secure module and the cookie is read, the cookie for 'symony' is totally different from what gets displayed on the homepage - this means its not reading the same cookie and thats why the 'log out' link doesnt appear until I visit the secure module. If after I open that secure module I go back to home page the application reads the cookie just fine and 'log out is displayed'.

I really have no clue how to approach this. Any help is greatly appreciated!

  • 写回答

3条回答 默认 最新

  • dsn46282 2009-06-29 22:20
    关注

    I've come accross this before.

    My code is at work, but the explanation given in this ticket seems familiar.

    http://trac.symfony-project.org/ticket/6607

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。