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 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?
  • ¥15 ubuntu系统下挂载磁盘上执行./提示权限不够
  • ¥15 Arcgis相交分析无法绘制一个或多个图形
  • ¥15 关于#r语言#的问题:差异分析前数据准备,报错Error in data[, sampleName1] : subscript out of bounds请问怎么解决呀以下是全部代码:
  • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
  • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)
  • ¥15 用前端向数据库插入数据,通过debug发现数据能走到后端,但是放行之后就会提示错误
  • ¥30 3天&7天&&15天&销量如何统计同一行
  • ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码
  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型