duanleiming2014 2012-09-04 13:16
浏览 18

FuelPHP SimpleAuth登录不在IE中工作

I'm having an apparently IE-only problem with FuelPHP's SimpleAuth login. It works fine on localhost, but on the staging version of the site I'm working on, Auth::check() always fails after login.

If I dump the contents of Auth::check() on validation of the login form, I get true, suggesting that the user has been successfully logged in. However, after I redirect the user to the next page (using Response::redirect), Auth::check() evaluates as false again. I don't think the problem is directly related to the redirect because even if I don't redirect the user, the login still fails.

For some reason this problem only seems to occur in IE (both 8 and 9). In Opera, Firefox, etc, the user login and logout works fine. As I said before, it also works in IE on my local development version. I can only think that it must be some cookie or session-handling problem, but I'm at a loss to figure out what the problem is. I'd be very grateful if anyone can shed any light on this!

I'm using FuelPHP version 1.1

  • 写回答

1条回答 默认 最新

  • dongwo1234 2013-01-04 16:21
    关注

    I have been stacking on the same problem all day long, finally, I solved it.

    In my case, the problem was on Safari / Mac, the session was killed every time after I logged in. In fact, it was because I use ajax calls( with relative path on the server ) to login my user, and apparently the ajax call send an user agent different with http calls, and the mismatching cause Fuel to kill the session.

    The solution that I use is to disable the match_ua value in the session configuration. For making things more secured, I enabled match_ip instead. I don't know if it was the good solution.

    I still don't know why the user agent will be different. If someone can make me more clear on this problem, thanks a lot.

    评论

报告相同问题?

悬赏问题

  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程