简体   繁体   中英

PHP session echo not working?

I have a page that generates a $_SESSION['variable'] that is dynamic, so when you refresh the page the session has a different value everytime ( just a value of 0-10 ). But when I refresh the page in firefox, nothing shows up, but in IE it works fine. I also tried in Opera but it doesn't show up there either. Anyone know why it's not echoing, and yes I session_start() at the top of my page so it should work...

I had a sort-of similar problem just now and the problem was due to the prefix of my URL.!

Let me explain, I defined my session in a page starting WITH "www." but the href to the second page was hastily defined without "www." at the beginning. After checking the COOKIES I realized that there were two distinct IDs for my sessions. Hope it helps.

Are cookies enabled on Firefox? If they are not you have to enable passing the session ID through the query string. I think that is disabled by default.

Do you have firebug installed for firefox? If so, do you have the firecookie addon

If so, you should see the presence of PHPSESSID. If you don't see any cookies, then chances are, this is your issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM