Hello Mukul,
������, 1999��7��17��, you wrote:
MG> Hi,
MG> The lines below which Craig has written seem to be quite important to
MG> understand. But here I have a confusion. Say in doGet() method I write a
MG> statement creating a session object [ HttpSession session =
MG> request.getSession(true) ]. Lets assume sessions are managed using
MG> persistent cookies.
MG> Now lets say a particular user has invoked a servlet from a particular
MG> client PC. Now that user's session is maintained by a cookie set by the
MG> servlet on his PC. Lets now say the same user on the same PC invokes the
MG> servlet again(either simultaneously or after some time lag). This another
MG> request by the same user would overwrite the cookie on his PC. Or does here
MG> the cookie is created new for another request by the same client ?
MG> I think it could be a different cookie. If its a different cookie then the
MG> same person is operating two sessions, otherwise there is only one session
MG> for that user.
MG> If there are seperate cookies for two invocations by the same client PC,
MG> then by identifying that cookie in servlet we could run different code for
MG> the same client. Otherwise, if cookie is same(i.e overwritten) for two
MG> different invocations from the same PC, everytime a new session is supposed
MG> to be created.
MG> Can somebody please clarify these concepts ? Specially synchronisation
MG> issue involved here(in relation to cookies & also using url rewriting
MG> mechanism).
Hello, I am new to servlet. I write a servlet it will write all the
info I can get from "require" in a HTML to browser, I think the
require is sent from the client to server, and the client's info is
stored in the require's header, one of the header name is SessionId, I
found that when you sent different require with a same browser( such
as IE), the SessionId is same, perhaps it is mean that are one
session, but when I sent same or different require to the servlet with
different browser( one is IE, the other is Netscape), the SessionId is
different, it means those are two sessions. if you store a timestamp
in the session, you will find the timestamp is the same one in case
1, and it is different in case 2. I don't know why.
MG> -mukul
>>> No, you cannot assume that this fact *alone* makes you thread-safe,
>>> because you
>>> cannot assume that the same user will not trigger more than one request at
>>> the
>>> same time (which would be handled by different threads accessing the same
>>> session
>>> object)..
>>>
>> [Scheiderer, Stephan]
>> SO, do I have to synchronize session object access??? (If a user
>>makes 2 requests at one time...)
>> [Scheiderer, Stephan] ????????????????
>> Does that anybody of you? Is this really necessary?
MG> ___________________________________________________________________________
MG> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
MG> of the message "signoff SERVLET-INTEREST".
MG> Archives: http://archives.java.sun.com/archives/servlet-interest.html
MG> Resources: http://java.sun.com/products/servlet/external-resources.html
MG> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
Best regards,
DragonTown mailto:[EMAIL PROTECTED]
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html