為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

start_session / session variable in PHP not read by Firefox

  • 7 回覆
  • 1 有這個問題
  • 11 次檢視
  • 最近回覆由 fpbosmans

more options

I have som PHP pages with session variables. It works (still) fine in Chrome and Microsoft Edge and until a few days ago it also worked fine in Firefox. All of a sudden Firefox doesn't get the value of the variables anymore.

Anyone any suggestions?

I have som PHP pages with session variables. It works (still) fine in Chrome and Microsoft Edge and until a few days ago it also worked fine in Firefox. All of a sudden Firefox doesn't get the value of the variables anymore. Anyone any suggestions?

所有回覆 (7)

more options

Hi fpbosmans, your server processes your PHP script and sends browsers standard HTML, CSS, and JavaScript. You can see what the server is sending by calling up View Source on your page in Firefox. Either:

  • Ctrl+u
  • right-click a blank area of the page > View Page Source
  • menu button > Web Developer > Page Source
  • (menu bar) Tools > Web Developer > Page Source

Does the source show the values that you expect?


Firefox can be very tenacious with cached data, so if the page is showing obsolete date, try reloading the page bypassing the cache. Either:

  • Shift+click the Reload button
  • Ctrl+F5
  • Ctrl+Shift+r
more options

No this doesn't work. Firefox doesn't read the session variables (refreshing the page doesn't help either). I'm guessing it has something to do with security settings.

Try this: http://dietrich.soundtoll.nl/public/index.php?periode=_vroeg

periode=_vroeg is saved as a session variable and should be available. But when you (I?) chose one of the options it has gone away and showing the page without 'periode' set. As I said: it wordkes before and it works in other browsers

more options

Hi fpbosmans, your link gives me this red text on the page:

"Database 1: 668.565 registrations; years 1497 - 1633."

Clicking Years after 1633 gives me:

" Database 2: 1.484.051 passages; years 1634 - 1857."

Clicking Years before 1634 switches it back.

I'm not sure what you mean by this part:

But when you (I?) chose one of the options it has gone away and showing the page without 'periode' set. As I said: it wordkes before and it works in other browsers

When I click Statistics, the red text is carried over to stats.php. I don't know whether that is what you meant by options.

more options

Thanks for your patience! That is exactly what should happen, the red text should stay the same! The new page reads the session variable to get the correct period. Only on my computer it all of a sudden doesn't work anymore, the session variable comes up empty. (And as I said not with other browsers.) Frank

more options

Actually, Firefox doesn't have access to session variables, those are stored in memory on the web server. Firefox sends the PHP session cookie to the server with each request, and that allows the PHP script to use the session variables. Can you think of any reason that Firefox would not be setting or returning cookies to your server?

more options

You can check the HTTP request headers in the Network Monitor to see what is send to the server if you click a link or button.

more options

In the end the solution was very simple: I have deleted all saved cookies and now it's working again!

Thanks for your help, your answers set me on the right track!