Harley1979 Posted May 13, 2007 Share Posted May 13, 2007 I've been having some trouble today... What I have basicaly established for myself is that when setting a session variable, and then redirecting or going to another page, that the data is lost. How can I stop this from happening? I'm sure session data would not normally disappear or would it? Any help would be great Thanks Quote Link to comment https://forums.phpfreaks.com/topic/51231-losing-session-data/ Share on other sites More sharing options...
Daniel0 Posted May 13, 2007 Share Posted May 13, 2007 Have you run session_start();? Quote Link to comment https://forums.phpfreaks.com/topic/51231-losing-session-data/#findComment-252348 Share on other sites More sharing options...
Harley1979 Posted May 13, 2007 Author Share Posted May 13, 2007 Yeah, I've used session_start(); and also session_write_close(); after setting the sessions values. It's such a mystery to me, is there something in php.ini I have to alter before it will allow me to use sessions or something? Although I think that sort of stuff is set up as standard with my hosting comany. Quote Link to comment https://forums.phpfreaks.com/topic/51231-losing-session-data/#findComment-252349 Share on other sites More sharing options...
boo_lolly Posted May 13, 2007 Share Posted May 13, 2007 session_start() needs to be at the very top of every page. Quote Link to comment https://forums.phpfreaks.com/topic/51231-losing-session-data/#findComment-252355 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.