Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

session

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
multiple users are logging in different nodes,if one user disconect with he server then how would server identify the client session.I think
server is able to maintain each client sessionID.but if the sessionID expires then how would server know its state? i don't by means of cookies.
pls clarify my doubt.

regading
Ramakrishnan.T
,
 
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ramakrishnan Thiyagarajan,

Speaking purely for myself, I think you're going to need to expand on your problem description a little as I can't quite grasp what you're getting at.

Taking a wild stab in the dark, are you familiar with getAttribute() and setAttribute() on HTTPSession?

Jules
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're asking: how would the server know if the user disconnected, then the answer is the server would not know. The server would continue to maintain the session for that user who disconnected until a predetermined amount of time of inactivity has passed - then the server would invalidate the session.
 
Ramakrishnan thiyagarajan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi julian,
Thanks for ur resp.But my question is, "how would the webserver maintain the client state?"
The answer is the server maintain client state using HtppSession object.
getSession() method used to store information about particulat client.ok.

Actually server is able to maintain mutiple client's state information.if one user disconnect with the server then "how would the server know?."

I think server would not care of this which maintains client information even client disconnect with server.pls clarify my doubt
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The server has no way of knowing whether a client has disconnected.
The server also has no way of assigning an existing session to another client.

[Edited to remove unnecessary comment]
[ August 18, 2004: Message edited by: Gregg Bolinger ]
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The server uses cookies, URL rewriting or SSL sessions to keep track of browsers sessions. Because HTTP is stateless, there is no way for the server to know when a client has disconnected; servers use a timeout to expire a session some time after the last request.

- Peter
 
JulianInactive KennedyInactive
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Paraphrasing what Jeroen and Peter have said, the misconception here is that the client is connected to the server. It's not (HTTP is stateless; disconnected). It may have an active session, but there's no connection as such, like with sockets. So the server can't know if the client "disconnects" as it was never connected in the first place.

Typically, a session will expire if no requests are made during a predetermined timeout period.

Does that make sense?

Jules
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic