wood burning stoves 2.0*
The moose likes Servlets and the fly likes Session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session" Watch "Session" New topic
Author

Session

Smita Kulkarni
Greenhorn

Joined: Dec 01, 2000
Posts: 5
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

Joined: Mar 22, 2000
Posts: 12756
    
    5
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Session
 
Similar Threads
how to give port number for socket class
new to Socket prgramming
problem in simple chat application.
Plain socket to SSL
Socket connection problem