nert Posted November 10, 2006 Share Posted November 10, 2006 Hi, I'd appreciate it if any of you could help or have seen this problem before becuase its causing me pain:I've got a simple session variable to log a username, nothing new in that I know, and all the code works fine under APACHE windows but not on APACHE Linux (Fedora 5) Basically, it looks like the session variable is not being set and therefore I can't pull the value out of it on a subsequent page.register_globals is off under both systens and best practice dicates it shouldn't be on anyway.Is there a switch I need to flick in one of the .ini or config files?Code for setting up:[code]session_start();session_unset;session_destroy();session_start();session_regenerate_id(); ..session_register("PHPSESSID"); $_SESSION['PHPSESSID'] = SESSION_ID();session_write_close();[/code]code for recovering data. this always comes out as Not set.[code]if (!isset($_SESSION['PHPSESSID'])){// show warnings}[/code] Link to comment https://forums.phpfreaks.com/topic/26818-session-var-works-in-windows-not-in-linux/ Share on other sites More sharing options...
kenrbnsn Posted November 10, 2006 Share Posted November 10, 2006 Please read the entry in the PHP manual on the [url=http://www.php.net/session_register]session_register()[/url] function.Ken Link to comment https://forums.phpfreaks.com/topic/26818-session-var-works-in-windows-not-in-linux/#findComment-122738 Share on other sites More sharing options...
nert Posted November 12, 2006 Author Share Posted November 12, 2006 Ah, that old "read the manual" chestnut, when will I learn?!Thanks, I understand now.The answer was that I didn't actually need session_register() at all. I recommend other people read the manual page too the user posts are good examples. Link to comment https://forums.phpfreaks.com/topic/26818-session-var-works-in-windows-not-in-linux/#findComment-123483 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.