When he logs in, he is taken to his home page, and instantly he is taken back to the login page. I feel as if his session is 'forgotten' or lost. I have verified that his cookies/session is set. I have made sure that the URLs match, and I've tried to isolate the problem line by line with no avail. This bug has only started happening to him, it doesn't not occur with me. If this is useful, his location is Pakistan.
Normally I'd paste code, but it's a lot, plus as a security precaution I cannot paste much. I can only describe as much as possible how it works should I need to.
I've had 3+ years of PHP, and I feel I'm fairly good at it.
Here are the Session Variables, in case you need them?:
Array
(
[in] => 1
[adm] => 1
[user] => John C Goodman
[user_id] => 0b25313888c462091a67dbacb78d39f3
[lang] => en_US
[ProfilePic] => http://www.sample.com/a/b/c/d/481d9a6a931783430c6c183ded479bd0_s.jpg
[username] => JCG
[whole_name] => John C Goodman
)
Here is a more detailed explanation of the login proceedure.
First user visits: https://www.sample.com/login.php
after he enters his email/password, the form is processed in login via if($_POST) detection. Once his credentials are verified a session is started with all the above variables set.
Then the login page tries to take him to his home page via the header() function, the url he's supposed to end up in is http://www.sample.com/home.php. (I use the "die()" function right after the header() function to prevent errors).
Once he touches ground on the home.php page, he is instantly redirected to the login page again. And through my line-by-line testing I have isolated the problem in the session handling script. Below is the code for that script:
<?php
date_default_timezone_set('UTC');
session_start();
if($_SESSION['in']){
//user is logged in
//set cookie
$cookie_val = md5($_SESSION['user_id']);
setcookie("censored", "{$cookie_val}", time()+259200);
}else{
//user is NOT logged in
session_destroy();
header("Location: https://www.7kins.com/login.php?");
}
?>
I am puzzled, I find no reason for this to fail, I am even more puzzled that this only happens to him and not me. I cannot at all understand what the problem is, I cannot even recreate the problem.

New Topic/Question
Reply



MultiQuote








|