From c73e73c37654f9f22160092a3080fe0134b2552d Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 20 May 2005 00:58:46 +0000 Subject: [PATCH] r162: - Changed admin cookie life to be 3600 (1 hour) - Renew cookie life span if we are authenticated in both admin/global.php and includes/init.php -- this is necessary for those who don't have remember me enabled --- admin/global.php | 5 +++++ includes/init.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/admin/global.php b/admin/global.php index c8b14f2..6efcf5d 100755 --- a/admin/global.php +++ b/admin/global.php @@ -78,6 +78,11 @@ if ($_COOKIE[COOKIE_PREFIX . 'adminsession']) $funct->cookie(COOKIE_PREFIX . 'adminsession', ''); $admin->error(phrase('invalid_admin_session_terminated')); } + else + { + // renew the cookie + $funct->cookie(COOKIE_PREFIX . 'adminsession', md5(md5($bugsys->userinfo['authkey']) . md5($bugsys->userinfo['email']) . md5($bugsys->userinfo['userid']))); + } } else { diff --git a/includes/init.php b/includes/init.php index 8b1eea0..02a352a 100755 --- a/includes/init.php +++ b/includes/init.php @@ -42,6 +42,9 @@ $bugsys->load('functions'); $bugsys->load('mail'); $bugsys->exec_sanitize_data(); +// change cookie expiration to one hour +$funct->cookieexp = 3600; + define('DEVDEBUG', $debug); define('TABLE_PREFIX', $tableprefix); define('COOKIE_PREFIX', $cookieprefix); @@ -85,6 +88,8 @@ if (is_array($userinfo) AND $_COOKIE[COOKIE_PREFIX . 'authkey'] == $userinfo['au fetch_user_display_name($userinfo); $userinfo['mdisplayname'] = $bugsys->datastore['usergroup']["$userinfo[usergroupid]"]['opentag'] . $userinfo['displayname'] . $bugsys->datastore['usergroup']["$userinfo[usergroupid]"]['closetag']; $bugsys->userinfo = $userinfo; + $funct->cookie(COOKIE_PREFIX . 'userid', $bugsys->userinfo['userid']); + $funct->cookie(COOKIE_PREFIX . 'authkey', $bugsys->userinfo['authkey']); } else { -- 2.43.5