Hi there - I had written some php for users to login to a password protected part of our site. Today an SSL certificate was installed. Previous to the SSL being installed the pages would timeout and kick the user out to the login screen after a certain period of time. Since the SSL was installed it kicks the user out to the root of the site. The only difference was that I had to change the .htaccess file to route everyone to the https instead of the http. Could this be the error?

The .htacess code is:

RewriteEngine On
RewriteCond %{SERVER_PORT} !443
RewriteRule (.*) https://www.mydomain.com/ [R]

The php code for the timeout (at the beginning of each file in that directory) is:

<?
session_start();
$inactive = 200;
if(isset($_SESSION['start']) ) {
$session_life = time() - $_SESSION['start'];
if($session_life > $inactive){
header("location: https://www.mydomain.com/subfolder/index.php");
}
}
$_SESSION['start'] = time();
if(!session_is_registered(myusername)){
header("location: https://www.mydomain.com/subfolder/index.php");
}
?>

Do not hardcode the www.mydomain.com/ just use the /subfolder/index.php Since it all attached to the same site and you are already on SSL, all you need to do/use is /subfolder/htmlfile

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.