shivani.shm Posted July 28, 2008 Share Posted July 28, 2008 hi all i m geting a strange problem ...my session variables are lost when redirecting the page and it has come all of a sudden as the same code was wrking fine ... and i m unable to retify the problem.....i m doing somethg like this session_start(); $_SESSION['USERNAME'] = $sUsername; $_SESSION['EMPLOYEEID'] = $aEmployee["employee_id"]; $_SESSION['POSTID'] = $aEmployee["post_id"]; $_SESSION['EMPLOYEENAME'] = $aEmployee["person_name_last"].", ".$aEmployee["person_name_first"]." ".$aEmployee["person_name_others"]; $_SESSION['EMPDIVISION'] = $aEmployee["company_division_id"]; when i try to print this array in another page i m geting the array empty can anyone plz tell me the why this is happening ....i m using firefox browser.....does any seting of firefox has to be changed......plz suggest thanks in advance Link to comment https://forums.phpfreaks.com/topic/116938-session-problem/ Share on other sites More sharing options...
scarhand Posted July 28, 2008 Share Posted July 28, 2008 session_start(); must be at the top of EVERY script Link to comment https://forums.phpfreaks.com/topic/116938-session-problem/#findComment-601335 Share on other sites More sharing options...
shivani.shm Posted July 28, 2008 Author Share Posted July 28, 2008 i have done session_start() at the start of the script and in the login page i m geting the session variables and also geting the session id in the next page but print_r($_SESSION) returns empty in the next page Link to comment https://forums.phpfreaks.com/topic/116938-session-problem/#findComment-601340 Share on other sites More sharing options...
MasterACE14 Posted July 28, 2008 Share Posted July 28, 2008 put session_start(); in the next page after the login. Link to comment https://forums.phpfreaks.com/topic/116938-session-problem/#findComment-601347 Share on other sites More sharing options...
shivani.shm Posted July 28, 2008 Author Share Posted July 28, 2008 its done still nt working Link to comment https://forums.phpfreaks.com/topic/116938-session-problem/#findComment-601350 Share on other sites More sharing options...
MasterACE14 Posted July 28, 2008 Share Posted July 28, 2008 where are these variables coming from? a form? $sUsername; Link to comment https://forums.phpfreaks.com/topic/116938-session-problem/#findComment-601352 Share on other sites More sharing options...
dg Posted July 28, 2008 Share Posted July 28, 2008 check ur server space Link to comment https://forums.phpfreaks.com/topic/116938-session-problem/#findComment-601394 Share on other sites More sharing options...
shivani.shm Posted July 28, 2008 Author Share Posted July 28, 2008 oh ya thks a lot tht was the problem............u r a genious Link to comment https://forums.phpfreaks.com/topic/116938-session-problem/#findComment-601396 Share on other sites More sharing options...
shivani.shm Posted July 28, 2008 Author Share Posted July 28, 2008 hi all i m geting a strange problem ...my session variables are lost when redirecting the page and it has come all of a sudden as the same code was wrking fine ... and i m unable to retify the problem.....i m doing somethg like this session_start(); $_SESSION['USERNAME'] = $sUsername; $_SESSION['EMPLOYEEID'] = $aEmployee["employee_id"]; $_SESSION['POSTID'] = $aEmployee["post_id"]; $_SESSION['EMPLOYEENAME'] = $aEmployee["person_name_last"].", ".$aEmployee["person_name_first"]." ".$aEmployee["person_name_others"]; $_SESSION['EMPDIVISION'] = $aEmployee["company_division_id"]; when i try to print this array in another page i m geting the array empty can anyone please tell me the why this is happening ....i m using firefox browser.....does any seting of firefox has to be changed......please suggest thanks in advance Link to comment https://forums.phpfreaks.com/topic/116938-session-problem/#findComment-601407 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.