Jump to content

How do I adjust length of log in time?


RyanSF07

Recommended Posts

;)

 

Only recently has this begun to happen...  I'm randomly logged off from the site for no apparent reason. It happens so frequently though that something must be causing it, but I haven't found out what, yet.

 

When a user logs in, I start a session - and begin each php page with session_start(). I don't know why the user_id variable is sometimes lost, resulting in "You must log in" message.

 

Any ideas what to look for? an absent session_start() maybe?

 

Thanks,

Ryan

 

//start session
session_start();
header("Cache-control: private"); //IE 6 Fix 

//Register session key with the value
$_SESSION[id] = $row[id];
$_SESSION[name] = "$row[user_name]"; //output success message

$content .= "<h1>Welcome <b>$_SESSION[name]!</b></h1>
<p>You are logged in.</p>";

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.