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 Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
shivani.shm Posted July 28, 2008 Author Share Posted July 28, 2008 its done still nt working Quote Link to comment 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; Quote Link to comment Share on other sites More sharing options...
dg Posted July 28, 2008 Share Posted July 28, 2008 check ur server space Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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.