Skip to content
Snippets Groups Projects
Commit 48261b64 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#280934 follow up by pwolanin: harden the cookie handling in sess_regenerate()...

#280934 follow up by pwolanin: harden the cookie handling in sess_regenerate() by setting our session cookie to be an HTTP only cookie, thus reducing the risk of session stealing via XSS
parent 153d9d38
No related branches found
No related tags found
No related merge requests found
......@@ -97,6 +97,10 @@ function sess_regenerate() {
setcookie(session_name(), '', time() - 42000, '/');
}
extract(session_get_cookie_params());
// Set "httponly" to TRUE to reduce the risk of session stealing via XSS.
// This has no effect for PHP < 5.2.0.
session_set_cookie_params($lifetime, $path, $domain, $secure, TRUE);
session_regenerate_id();
db_query("UPDATE {sessions} SET sid = '%s' WHERE sid = '%s'", session_id(), $old_session_id);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment