Why won't my session variable set

i have this code:


$_SESSION['flash'] = "<p>text here</p>";

and on a different page if I echo $_SESSION[‘flash’], nothing echos.

I do have session_start(); at the top of the page I’m trying to echo $_SESSION[‘flash’] from. and if I run print_r($_SESSION); I do get other SESSION variables so I know the session still exists, right? What else can I check?

Thanks for the help.

i didn’t change anything and now it’s working. I noticed before that when i update and save this network file it takes some time for the update to appear on the page i’m viewing from our network. there is sometimes a 5 min lag at most. yesterday it was a few hours… but that is just a thought because I didn’t change anything.

Hi
I agree with UFTimmy and Aaron D.
Did you start the session in all the other page. I mean

session_start();

if you do not start the session you cannot get the value that is set in the session.

Also check if you do a if($_SESSION['flash'] = 'something') somewhere.

I am assuming the session is active both on the page that sets it and on the page that retrieves it.

Run a search through your code and see if there is anywhere that modifies or unsets that session variable.