Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read Session Id using Javascript

Is it by any means possible to read the browser session id using javascript?

like image 328
Nahom Tijnam Avatar asked May 28 '09 12:05

Nahom Tijnam


People also ask

How do you get a session ID in Javascript?

php session_start(); $id = session_id(); echo $id; ?> This will return you the current session id.

How do I get my session ID?

Session IDs are typically found in the Request (NCSA) field, the URI-Query (W3C), or the Cookie field: If the ID is found in the URL itself, it will be in the Request field for Apache servers and in the URI Query field for IIS servers.

What is view session ID?

A session ID is a unique number that a Web site's server assigns a specific user for the duration of that user's visit (session). The session ID can be stored as a cookie, form field, or URL (Uniform Resource Locator). Some Web servers generate session IDs by simply incrementing static numbers.

How is session ID generated in Java?

A session-id is obtained by taking an MD5 hash over 128- bits generated using one of Java's pseudo-random number generators (PRNG).


1 Answers

Yes. As the session ID is either transported over the URL (document.location.href) or via a cookie (document.cookie), you could check both for the presence of a session ID.

like image 165
Gumbo Avatar answered Sep 19 '22 18:09

Gumbo