Jump to content

Cookie probloms?


Recommended Posts

I'm not really sure if this is a cookie problem but that's all I could think of. I have a web site that users have to log into. I have seen that when I log out of my account and log into my test account my main user name will still show on the welcome page unless I let the computer sit for a bit or if I clear recent history. This happens in all the main browsers. I have also started having a problem where if I update something in my database it shows up in MySQL right away but can take a while to show up on the web page unless i clear the history. Not sure what code to post to give you an idea so if you want to see something let me know and I will put it up.


Thank you

Link to comment
Share on other sites

This is my log in scrip

include"scripts/connect.php" ;

@mysql_select_db($database) or die( "Unable to select database");


$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);

$sql="SELECT * FROM user WHERE username='$myusername' and password='$encrypted_password' and active=1";

$row = mysql_fetch_assoc($result);
    $rank = $row['rank'];
$loggedinusername = $row['username'];
$loggedinuseremail = $row['email'];

$_SESSION['login'] = "1"; 
$_SESSION['rank'] = $rank;
$_SESSION['loggedinusername'] = $loggedinusername;
$_SESSION['loggedinuseremail'] = $loggedinuseremail;
header ("Location:index.php");
} else { 
$errorMessage = "Invalid Login"; 
$_SESSION['login'] = '';
header ("Location:login.php");


and this is my session

$_SESSION['loggedinusername'] = $loggedinusername;
$_SESSION['loggedinuseremail'] = $loggedinuseremail;

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

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

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.