Skip to content Skip to sidebar Skip to footer

How Do I/can I Access A Sessionid Cookie Through Javascript?

I've installed the cookie extension for jquery, and am attempting to access the session id cookie. I currently have two cookies for my session - see screenshot below: however, $.c

Solution 1:

The session id cookie should be marked as HTTP Only, preventing access from javascript. This is a security issue, preventing session hijacking via an xss vulnerability.

You can see in your screenshot that the cookie is indeed marked as HTTP.


If you want to learn more about the flag see here. Originally implemented by IE, most browsers support the flag nowadays, and session cookies not marked http-only are considered a security flaw. Also see here.


Post a Comment for "How Do I/can I Access A Sessionid Cookie Through Javascript?"