0

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");
}
?>
2
Contributors
1
Reply
12
Views
5 Years
Discussion Span
Last Post by patk570
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.