Add expire setting to auth cookie
This commit is contained in:
parent
4beccff539
commit
493f548e05
|
@ -12,6 +12,9 @@ include "newsportal.php";
|
||||||
|
|
||||||
include "head.inc";
|
include "head.inc";
|
||||||
|
|
||||||
|
// How long should cookie allow user to stay logged in?
|
||||||
|
// 14400 = 4 hours
|
||||||
|
$auth_expire = 14400;
|
||||||
$logged_in = false;
|
$logged_in = false;
|
||||||
if(!isset($_POST['username'])) {
|
if(!isset($_POST['username'])) {
|
||||||
$_POST['username'] = $_COOKIE['cookie_name'];
|
$_POST['username'] = $_COOKIE['cookie_name'];
|
||||||
|
@ -27,7 +30,8 @@ include "head.inc";
|
||||||
if (navigator.cookieEnabled)
|
if (navigator.cookieEnabled)
|
||||||
var authcookie = "<?php echo $authkey; ?>";
|
var authcookie = "<?php echo $authkey; ?>";
|
||||||
var savename = "<?php echo stripslashes($name); ?>";
|
var savename = "<?php echo stripslashes($name); ?>";
|
||||||
document.cookie = "auth=" + authcookie;
|
var auth_expire = "<?php echo $auth_expire; ?>";
|
||||||
|
document.cookie = "auth="+authcookie+"; max-age="+auth_expire+";";
|
||||||
document.cookie = "cookie_name=" + savename;
|
document.cookie = "cookie_name=" + savename;
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
|
|
Loading…
Reference in New Issue