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.
1 Answer
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.
2 Comments
albanx
or just use post ajax request when you write variables, and get when you read them
themhz
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
session_start()at the top of all your scripts, AJAX or conventional?