3

I set several php session variables in an initial php file. In all other ajax loaded php files the value of those session variables is updated only after refreshing the page. This happens only in Firefox. Does anyone know what may cause this to happen? In IE everything works fine.

2
  • 2
    Is there session_start() at the top of all your scripts, AJAX or conventional? Commented Sep 27, 2011 at 21:49
  • Probably the ajax requests are fired after the file has loaded? Commented Sep 27, 2011 at 22:13

1 Answer 1

4

I found a solution. There was a cache issue. Write:

header("Cache-Control: no-cache");
header("Pragma: no-cache");

after

session_start();

in all your conventional scripts.

Sign up to request clarification or add additional context in comments.

2 Comments

or just use post ajax request when you write variables, and get when you read them
oh man, you are the hero of the day. here was my problem stackoverflow.com/questions/11961920/… and finally after adding the headers before reseting the session variable caused firefox to reset the session variable finally!. Thanx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.