This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is a session id cookie sent only in the first response?

 
Tony suankularb
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assume that the client's browser enable cookies.

If a container receive the first request and return a session id cookie in the first response.

As far as I remember, for the next requests, the container won't send the session id to the client again.


I'm confused because at the bottom of page 238 of HFSJ, it says about the second request from a client.

"the Container reads the session ID from the request, finds the session, and thinks to itself, “This client accepts cookies, so I can ignore the response.encodeURL() calls. In the response, I’ll send a cookie since I know that works, and there’s no need for any URL rewriting, so I won’t bother...

 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the browser first accesses a resource on the web app it does not send a session id.
So the container generates one and sends it back within the response.

Subsequent requests will all contain the session ID the container once created, so the container does not have to send the session ID back again, it's overhead. Only if the session expires, gets lost or stuff like that, the container will create a new one as the user is unknown again.
 
Tony suankularb
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That was I understood.

Thank you, Sebastian

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic