Skip to content

Commit

Permalink
Merge branch '6217-security-set-cookie-settings-to-true-for-option-ht…
Browse files Browse the repository at this point in the history
…tponly' into '1.3-fixes'
  • Loading branch information
bilbo-the-hobbit committed Jul 5, 2022
1 parent a316b52 commit fadebb7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/class_session.inc
Expand Up @@ -151,6 +151,13 @@ class session {
!! The garbage collector is a cron job on debian systems, the cronjob will fetch the timeout from
the php.ini, so if you use debian, you must hardcode session.gc_maxlifetime in your php.ini */
ini_set("session.gc_maxlifetime", 24 * 60 * 60);

/*
* Set HttpOnly in order to enhance security by disabling execution of javascript on cookies,
* allowing possible XSS attacks
*/
ini_set("session.cookie_httponly", "1");

if ($id !== NULL) {
session_id($id);
}
Expand Down

0 comments on commit fadebb7

Please sign in to comment.