jjk2 Posted September 2, 2009 Share Posted September 2, 2009 very strange. the scripts were working without problem. i made no changes. i have add.php, which writes to session_start(); $_SESSION['vars'][] = $data then i have view.php session_start(); print_r($_SESSION['vars']); view.php returns empty array().... but all this time, code was working perfectly, and view.php were outputting appropriate contents.... i dont understand what is going on.... Quote Link to comment https://forums.phpfreaks.com/topic/172904-solved-_session-variable-inaccessbile/ Share on other sites More sharing options...
Kieran Menor Posted September 2, 2009 Share Posted September 2, 2009 Try printing session_id() on both pages to check if they are the same. If they aren't it might be a cookie problem in your browser. Quote Link to comment https://forums.phpfreaks.com/topic/172904-solved-_session-variable-inaccessbile/#findComment-911273 Share on other sites More sharing options...
jjk2 Posted September 2, 2009 Author Share Posted September 2, 2009 yes they are different..... i dont understand why....everything was working fine till today. Quote Link to comment https://forums.phpfreaks.com/topic/172904-solved-_session-variable-inaccessbile/#findComment-911274 Share on other sites More sharing options...
Philip Posted September 2, 2009 Share Posted September 2, 2009 Did you try print_r($data) on the first page? Did you do any changes to your browser, or to the .ini ? Quote Link to comment https://forums.phpfreaks.com/topic/172904-solved-_session-variable-inaccessbile/#findComment-911275 Share on other sites More sharing options...
Kieran Menor Posted September 2, 2009 Share Posted September 2, 2009 Try clearing your cookies. Quote Link to comment https://forums.phpfreaks.com/topic/172904-solved-_session-variable-inaccessbile/#findComment-911276 Share on other sites More sharing options...
jjk2 Posted September 3, 2009 Author Share Posted September 3, 2009 Did you try print_r($data) on the first page? Did you do any changes to your browser, or to the .ini ? i have not made any change to browser or ini. was there a major firefox update ? i have recently upgraded to php 5.2.8....but left php.ini unchanged...even then it was working fine. just today suddenly, it fails. yes i have tried print_r($data) on first page....it works... print_R($_SESSION['vars']) on first page, also works. so it is writing to the session varaible correctly. Quote Link to comment https://forums.phpfreaks.com/topic/172904-solved-_session-variable-inaccessbile/#findComment-911285 Share on other sites More sharing options...
PFMaBiSmAd Posted September 3, 2009 Share Posted September 3, 2009 Add the following two lines of code immediately after the first opening <?php tag on both pages - ini_set("display_errors", "1"); error_reporting(E_ALL); Quote Link to comment https://forums.phpfreaks.com/topic/172904-solved-_session-variable-inaccessbile/#findComment-911290 Share on other sites More sharing options...
jjk2 Posted September 3, 2009 Author Share Posted September 3, 2009 Notice: Undefined index: vars in /view.php on line 8 i made changes to .htaccess yesterday i just remembered.... i delieted .htaccess. Quote Link to comment https://forums.phpfreaks.com/topic/172904-solved-_session-variable-inaccessbile/#findComment-911306 Share on other sites More sharing options...
jjk2 Posted September 3, 2009 Author Share Posted September 3, 2009 also, add.php is loaded via iframe..... view.php is not. Quote Link to comment https://forums.phpfreaks.com/topic/172904-solved-_session-variable-inaccessbile/#findComment-911332 Share on other sites More sharing options...
jjk2 Posted September 3, 2009 Author Share Posted September 3, 2009 anyone? could this be the result of .htaccess tinkering? i was redirecting stuff earlier. Quote Link to comment https://forums.phpfreaks.com/topic/172904-solved-_session-variable-inaccessbile/#findComment-911361 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.