Jump to content

All of a sudden


Distant_storm

Recommended Posts

My php script works like this

 

it checks if the sessions is present and the values against a database and will direct to where they should be directed.

 

If their login is wrong their directed to login page or if the session value isnt present then they are redirected.

 

 

Now all of a sudden it is being tempremental and redirecting to login at what seems to be random times navigating around the system

 

Link to comment
Share on other sites

this part of the code is in the index'd file

 

if ($page_directory != 0 && check_auth_user_() != "ALLOW") {
header("LOCATION:index.php?direct=0");
exit();
}

 

$page_directory = navigation pointer

check_auth_user_() checks login see code below.

navigation pointer of 0 = login page.

 

 


function check_auth_user_() {

$matrix_path="MYSESSIONPATH";

ini_set('session.save_path',"../../" . $matrix_path . "_");
ini_set('session.gc_maxlifetime', '1440');

session_start();

if (isset($_SESSION['auth']) && isset($_SESSION['user_id'])) {

if ($dbc = @mysql_connect('host','XXXXX','XXXXX')) {

if (@mysql_select_db('DATEBASE')) {

$name=$_SESSION['user_id'];

$query="SELECT * FROM administration WHERE ID='$name'";

if ($r= mysql_query ($query)) {

while ($row = mysql_fetch_array($r)) {

$password=$_SESSION['auth'];

$do_auth= md5($password . $row['key']);
$auth_true= md5($row['password'] . $row['key']);

if ($do_auth == $auth_true) {


return("ALLOW");


} else {

return("DENIE");

}
}
}
}
}
}
}

 

that is the code for the check function.

 

Non of the login has been changed, non of the database entries have changed???

 

What woudl make the script randomly log me out

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.