Skip to content

Commit

Permalink
WebSession: HttpOnly attribute in stub cookies
Browse files Browse the repository at this point in the history
* Adds HttpOnly attribute to stub cookies as well.  (addresses inveniosoftware#3064)

Signed-off-by: Tibor Simko <[email protected]>
Reviewed-by: Lars Holm Nielsen <[email protected]>
  • Loading branch information
tiborsimko authored and Wojciech Ziółek committed Jun 5, 2015
1 parent 951e2ce commit bb7b779
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/websession/lib/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,9 @@ def make_cookies(self):
cookies = []
uid = self.get('uid', -1)
if uid > 0 and CFG_SITE_SECURE_URL.startswith("https://"):
stub_cookie = Cookie(CFG_WEBSESSION_COOKIE_NAME + 'stub', 'HTTPS')
stub_cookie = Cookie(CFG_WEBSESSION_COOKIE_NAME + 'stub', 'HTTPS', HttpOnly=True)
else:
stub_cookie = Cookie(CFG_WEBSESSION_COOKIE_NAME + 'stub', 'NO')
stub_cookie = Cookie(CFG_WEBSESSION_COOKIE_NAME + 'stub', 'NO', HttpOnly=True)
cookies.append(stub_cookie)
if self._req.is_https() or not CFG_SITE_SECURE_URL.startswith("https://") or uid <= 0:
cookie = Cookie(CFG_WEBSESSION_COOKIE_NAME, self._sid)
Expand Down

0 comments on commit bb7b779

Please sign in to comment.