Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session

 
Smita Kulkarni
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is a session mapped to a socket. I mean, whenever a request comes from a new client, a new socket connection is created at the server and a session is started for that user(if a session is needed). How is this mapping done.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best way to think of this is in terms of the Thread that is assigned to a particular request, not the socket. Those details are taken care of by the servlet engine.
The engine can see if a session has been assigned to this user by looking for a session id in the HTTP request cookies or as part of a rewritten URL.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic