meltingpoint Posted September 15, 2009 Share Posted September 15, 2009 I have protected pages that have this code at the start of each page <?php $access_level = 6; // Change to a higher group number if required include("tfc_paths.php"); $ip = $_SERVER['REMOTE_ADDR']; require ($login_path."/tfc_user_perm_check.php"); ?> tfc_paths.php is; <?php $sec_path ='/home/andy128/select'; $site_path ='/home/andy128/public_html/XXXXXXXX.com'; $login_path ='/home/andy128/public_html/XXXXXXXX.com/tfc_login'; ?> and tfc_config.php is; <?php $no_access ="<center><br><br>I am sorry- you do not have sufficient privileges to view this page.<br>To return to the <strong>Landing Page</strong>- <br><br>click on the <strong>Landing Page Link</strong> link to the left.<br><br>If you have questions or to report problems<br>-- please contact the Website Administrator.</center>"; $ip_security ="<center><br><br>There is a security problem with your session and the IP address. Please notify the site Administrator.</center>"; $sign_in ="<center><br><br>To reach this page- you must be a member and sign in. Please go to the Main Page and sign in.</center>"; $site_administrator = 'keith.andersen@gmail.com'; // $tfc_file1 = $sec_path."/tfc_arrest_db.txt"; $tfc_file2 = $sec_path."/tfc_vehicle_db.txt"; $tfc_file3 = $sec_path."/tfc_additional_case_data_db.txt"; $tfc_file4 = $sec_path."/tfc_users_db.txt"; $tfc_file5 = $login_path."/login_log.txt"; // function sanitize_data($var) { $var = trim(strip_tags($var)); $bads = array("{" , "[" , "`" , "<" , ">" ); $var = str_replace($bads, "" , $var); return $var; } // ?> and the tfc_user_perm_check.php is <?php session_start(); // include $sec_path."/tfc_config.php"; // // if(empty($_SESSION['Susername'])) { $message = $sign_in; include ( $login_path."/message_page.php"); session_destroy(); exit; } // // if (substr_count($_SESSION['Sperm'], $access_level) != 1 ) { $message = $no_access; include ( $login_path."/message_page.php"); exit; } //--------Check to see if the SESSION IP and the USERS IP still match-------------- // if($_SESSION['ip'] !== $ip) { $message = $ip_security; include ( $login_path."/message_page.php"); session_destroy(); exit; } ?> with things just as they are- the first time you sign in- it defaults to the message where Susername is empty. Log out and try again- it works fine. For some reason- I can only get the session variables to go one page. Upon trying to go to a third page- the session is ended and it reverts to the Susername is empty message. Any suggestions would be welcome. Quote Link to comment Share on other sites More sharing options...
meltingpoint Posted September 15, 2009 Author Share Posted September 15, 2009 To add to this..............on freshly opened browser the session variables do not pass from page to page. However, if I log_out of the session and then log back in- the variables pass from page to page with no problem for all users. Weird Quote Link to comment Share on other sites More sharing options...
meltingpoint Posted September 15, 2009 Author Share Posted September 15, 2009 ***Solved- My coding works correctly- it appears to be an anomaly in FireFox as it works perfectly fine in IE ( now there's a switch!). In all my searches I did not fine a reported bug with FF with regard to this issue. 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.