Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php session variables problem in Firefox

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.

like image 644
Daniel Buhai Avatar asked Jun 07 '26 10:06

Daniel Buhai


1 Answers

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.

like image 199
Daniel Buhai Avatar answered Jun 09 '26 00:06

Daniel Buhai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!