> Nikolaos,
>     I think I understand the problem. Let me rephrase it just to make sure
> that we are on the same tracks...
>     The problem is not getting a unique id here. the problem is how to
> understand that this user has already started his session and hence you
need
> somehting like - getCurrentUserID() which should return the user-id if
> existing or else call getNewID(). Correct?
>     Or do you want to make the current user perisistent across all
sessions
> from that machne? I dont think that is the case. you will have to store
the
> user and the m/c info in a perisistent manner in that case...
>
>     If my first assumption is true, then how do we do it?
>     1 - Write a cookie with the user-id, but we come back to the
> cross-browser problem.
>     2 - Rewrite every URL with the user-id once the session has started.
> this would mean using client side coding. What i am thinking is we can
have
> a variable in the client code which would be initilized once the session
is
> created. then whenever a link is clicked which will call the servlet, then
> this id would be passed. this will be your cue that the user is
'logged-in'
> and hence you do not create a new session. The problem would be if the
user
> now opens a new browser, in which case the variable would be null.
>     To overcome this problem, you can have all the pages which has links
to
> your servlet be converted into a servlet which would write the links with
> the current user-id. So we now come back to the problem of getting the
> correct user id. Would this problem be solved if you remember the machine
> IP-address as part of the user-info(getremotehost())?
>
>     I am beginning to think that if you associate a user-id with the
machine
> address, then things might be more easier. So a getCurrentUserID() would
be
> passed the machine address. this fn would check in your hashtable is there
> an entry. If yes, then do some more validation whther this a valid
ssession.
> If yes, then return the user0id associated with th machine. If this is the
> furst request coming from the machine, then call getNewID() and store this
> informaiton in the hashtable.
>
>     This looks a bit shaky...
>
> Raaj.
>
>
>
> ----- Original Message -----
> From: Nikolaos Giannopoulos <[EMAIL PROTECTED]>
> To: 'Rajendra Mishra' <[EMAIL PROTECTED]>
> Cc: Servlet Interest Technology. <[EMAIL PROTECTED]>
> Sent: Thursday, January 13, 2000 11:22 AM
> Subject: RE: Is Global Session Possible?
>
>
> > Raaj,
> >
> > I'm not sure that this would work since each call to the servlet would
> > result in a new ID.  I need to have something such that 1 or more calls
> > from a specific user (from 1 or more browser sessions OR spawned
windows)
> > results in a SINGLE NEW ID (that is shared).
> >
> > Any thoughts....
> >
> > --Nikolaos
> >
> >
> > On Thursday, January 13, 2000 8:55 PM, Rajendra Mishra
> > [SMTP:[EMAIL PROTECTED]] wrote:
> > > Nikolaos,
> > >     This is just a suggestion and might not be the best way...
> > >     Write a java class which would return a new number. (remember to
> > > synchronize these methods). Thus if servlet1 calls
> > IDGenerator.getNewID(),
> > > it would return 1. When servlet2 calls it, it would return 2 and so
on.
> > > There would be a roll value as defined by you - 999999..(?) when you
> > would
> > > strt again from 1.
> > >     This would be a very crude method to define a user but
nevertheless
> > > workable in, my opinion. What do you think??
> > > Raaj.
> > >

___________________________________________________________________________
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

Reply via email to