Skip to content
This repository has been archived by the owner on Feb 3, 2020. It is now read-only.

Added protection against XSS cookie-theft attacks #12

Merged
merged 1 commit into from
Apr 26, 2011
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/cookie-sessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ var exports = module.exports = function(settings){
if ("cookie" in req.headers) {
cookiestr = escape(s.session_key) + '='
+ '; expires=' + exports.expires(0)
+ '; path=/';
+ '; path=/; HttpOnly';
}
} else {
cookiestr = escape(s.session_key) + '='
+ escape(exports.serialize(s.secret, req.session))
+ '; expires=' + exports.expires(s.timeout)
+ '; path=/';
+ '; path=/; HttpOnly';
}

if (cookiestr !== undefined) {
Expand Down