inspire Posted September 26, 2007 Share Posted September 26, 2007 Friends ... i have very big problem setting the session in php4.0.5. here the code i tested. page1.php <?php session_start(); echo session_id(); $_SESSION['u_name'] = "test"; ?> page2.php <? session_start(); echo session_id(); echo $_SESSION['u_name']; ?> error message in page2.php Warning: Cannot send session cache limiter - headers already sent (output started at C:\apache\htdocs\ots\page2.php:2) in C:\apache\htdocs\ots\page2.php on line 3 Quote Link to comment https://forums.phpfreaks.com/topic/70698-session-not-work-error-cannot-send-session-cache-limiter/ Share on other sites More sharing options...
darkfreaks Posted September 26, 2007 Share Posted September 26, 2007 put ob_start(); at the top of the page Quote Link to comment https://forums.phpfreaks.com/topic/70698-session-not-work-error-cannot-send-session-cache-limiter/#findComment-355382 Share on other sites More sharing options...
inspire Posted September 26, 2007 Author Share Posted September 26, 2007 still cannot solve the problem...set ob_start() at top Quote Link to comment https://forums.phpfreaks.com/topic/70698-session-not-work-error-cannot-send-session-cache-limiter/#findComment-355384 Share on other sites More sharing options...
marcus Posted September 26, 2007 Share Posted September 26, 2007 Try setting the session_id as a variable and echo that out. Quote Link to comment https://forums.phpfreaks.com/topic/70698-session-not-work-error-cannot-send-session-cache-limiter/#findComment-355386 Share on other sites More sharing options...
cooldude832 Posted September 26, 2007 Share Posted September 26, 2007 pre 4.3 (it might be 4.1 i don't remember) you must use the session_register() funciton give sessions values vs the super global array of $_SESSION Quote Link to comment https://forums.phpfreaks.com/topic/70698-session-not-work-error-cannot-send-session-cache-limiter/#findComment-355388 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.