Skip to content

Commit

Permalink
Merge branch 'MDL-56129-31' of git://github.com/andrewnicols/moodle i…
Browse files Browse the repository at this point in the history
…nto MOODLE_31_STABLE
  • Loading branch information
David Monllao committed Oct 24, 2016
2 parents 9edd48f + 9c74040 commit 1483afc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/classes/session/manager.php
Expand Up @@ -252,7 +252,12 @@ protected static function prepare_cookies() {

// Set configuration.
session_name($sessionname);
session_set_cookie_params(0, $CFG->sessioncookiepath, $CFG->sessioncookiedomain, $cookiesecure, $CFG->cookiehttponly);
// The session cookie expiry time cannot be extended so this needs to be set to a reasonable period, longer than
// the sessiontimeout.
// This ensures that the cookie is unlikely to timeout before the session does.
$sessionlifetime = $CFG->sessiontimeout + WEEKSECS;
session_set_cookie_params($sessionlifetime, $CFG->sessioncookiepath, $CFG->sessioncookiedomain,
$cookiesecure, $CFG->cookiehttponly);
ini_set('session.use_trans_sid', '0');
ini_set('session.use_only_cookies', '1');
ini_set('session.hash_function', '0'); // For now MD5 - we do not have room for sha-1 in sessions table.
Expand Down

0 comments on commit 1483afc

Please sign in to comment.