herghost Posted November 23, 2010 Share Posted November 23, 2010 For the last few hours I have been pulling my hair out on a session not storing when I moved from local host to my vps. I have been setting sessions like: $_SESSION['mydata'] = $variable; This works no problem on my wamp installation. However to get it to work on my vps, I have to store them like this $_SESSION[mydata] = $variable; Can someone please explain to me why this is the case? Link to comment https://forums.phpfreaks.com/topic/219519-_session-help/ Share on other sites More sharing options...
trq Posted November 23, 2010 Share Posted November 23, 2010 Do you have register_globals switched on? Link to comment https://forums.phpfreaks.com/topic/219519-_session-help/#findComment-1138196 Share on other sites More sharing options...
herghost Posted November 23, 2010 Author Share Posted November 23, 2010 Off on both ?! Link to comment https://forums.phpfreaks.com/topic/219519-_session-help/#findComment-1138198 Share on other sites More sharing options...
trq Posted November 23, 2010 Share Posted November 23, 2010 Well, the second way is invalid unless you have a constant defined called mydata. Link to comment https://forums.phpfreaks.com/topic/219519-_session-help/#findComment-1138201 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.