I,m reading Head first
Servlets &
JSP Chapter 6 Session Management.
For sending a Kookie in response or getting a Kookie in request we create a HttpSession Object as below
HttpSession session1 =request.getSession() ....(1)
or,
HttpSession session1 =request.getSession(false)...(2)
With the above session object created,the container takes care of generating sessionID,
creating a new Kookie object,stuffing the sessionID into Kookie and stuffing the Kookie
as a part of response.On subsequent requests,the container gets the sessionID,from the Kookie in the request,
matches the sessionID with the existing session and associates the session with current request.
Accordingly I tried a program as below
The output is as below:
EFA974B5F96EDC2432CDCC9F690FA25F
javax.servlet.http.Kookie@fae78f
I'm puzzzled with the output . "EFA974B5F96EDC2432CDCC9F690FA25F" refers to session id.
what "javax.servlet.http.Kookie@fsd45f" refers to?
where is the cookie with the above session id stored on my system.