View Full Version : Session problem on this site, need some help please.

07-07-2005, 05:28 PM
I'm no php guru but I've worked with sessions before and have not run into this. Reading the manual didn't provide any clues either.

Problem: When sessions are in use some pages will not load. It is somewhat random, 6/10 attempts the page may not load. This appears to be limited to the IE browser. Removing session_start results in the problem going away 100%.

Code: Only the php is posted below, you can see the page source by viewing it from your browser if you like. This is the only php in the page, the rest is just html.

Reproduce It:This is the general site link (it's a work in progress): www.nvreefers.org, on the menu click on the "Links" link while using IE. If the page loaded go back and repeat. Usually in the first few tries the "Links" page will fail to load, you'll end up with a blank page. I've left session_start in the "Links" page to demonstrate the problem.

If anyone knows what the issue could be please help me out! This has been driving me nuts. I use MOZ and didn't even realize the problem until someone pointed it out), so for now all sessions are disabled on the site which is a big problem.

07-07-2005, 05:34 PM
shot in the dark here, but try a session_write_close() at the end of your script.

07-07-2005, 05:57 PM
Thanks for the suggestion but it didn't help.

One more piece of information - When the page fails to load the URL in IE still displays the URL of the page you were navigating from, not the URL of the "Links" page. I'm not sure what to make of this either. Could it be something to do with the way php write the session id to the hyperlinks? Are there any settings that can be tweaked in that regard?

07-07-2005, 06:05 PM
Just for the hell of it I added:
header("Cache-control: private");

Everything appears to be working now. I should have tried this right away but I wasn't posting anything via forms on most of the pages so I figured it wouldn't help. If anyone can verify the "Links" page appears to be loading correctly on IE I'd appreciate the feedback

07-07-2005, 06:10 PM
The links page seemed to work fine for me, but your homepage was blank the first time it loaded, I had to refresh it to see it.

07-07-2005, 06:34 PM
Thanks, I was just changing the code there to test also. The same problem cropped up, and the fix seemed to work there also, so I think everything is good. I really do hate MS... always a PITA to deal with their garbage.