仅在 Google Chrome & 中随机丢失会话变量URL重写 [英] Randomly Losing Session Variables Only In Google Chrome & URL Rewriting

查看:26
本文介绍了仅在 Google Chrome & 中随机丢失会话变量URL重写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用谷歌浏览器时,在页面(PHP 5.0.4、Apache 2.0.54)之间导航时,我似乎丢失/损坏了会话数据.该网站在 IE7/8、Firefox、Safari 和歌剧.该问题仅与 Google Chrome 相关.

Using Google Chrome, I'm seemingly losing/corrupting session data when navigating between pages (PHP 5.0.4, Apache 2.0.54). The website works perfectly fine in IE7/8, Firefox, Safari & Opera. The issue is only with Google Chrome.

我缩小了问题的范围.我正在使用搜索友好的 URL,并通过 .htaccess 文件隐藏我的前端控制器 (index.php).所以 URL 看起来像: www.domain.com/blah/blah/这是 .htaccess 文件内容:

I narrowed down the problem. I'm using search friendly URL's, and hiding my front controller (index.php) via a .htaccess file. So the URL looks like: www.domain.com/blah/blah/ Here's the .htaccess file contents:

Options +FollowSymlinks 
RewriteEngine on
#allow cool urls 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*) index.php [L] 
#allow to have Url without index.php 

如果我删除 .htaccess 文件,并在 URL 中公开前端控制器:www.domain.com/index.php/blah/blah/,Chrome 工作正常.

If I remove the .htaccess file, and expose the front controller in the URL: www.domain.com/index.php/blah/blah/, Chrome works perfectly fine.

有什么想法吗?我认为 Chrome 如何识别要使用的 cookie 并将其发送到服务器存在某种问题?这发生在 Chrome 4 &5. 谢谢!

Any thoughts ideas? I'm thinking it's some kind of problem with how Chrome identifies what cookie to use and send to the server? This happens in Chrome 4 & 5. Thanks!

推荐答案

我遇到了同样的问题,为了解决它,我只需要创建一个 favicon.ico 并将其放在 webroot 中 - 否则我可以看到使用 Fiddler来自 Chrome 的每个页面请求都会导致 404(尽管我实际上没有链接到页面标记中的网站图标).

I had the same issue, and to fix it I only had to create a favicon.ico and place it in the webroot - otherwise I could see using Fiddler that a 404 resulted for this with every page request from Chrome (despite me not actually linking to a favicon in the page markup).

在我看来,这显然是 Chrome 中的一个错误,因为缺少网站图标应该与会话数据无关.

In my mind this is clearly a bug in Chrome, as the lack of a favicon should have no bearing on session data.

这篇关于仅在 Google Chrome & 中随机丢失会话变量URL重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆