Something I implemented....
Requirement : I have multiple servlets on my site, each doing a specific
job, then rendering a page and then redirecting the user to the other
servlet, depending on links the user clicks.
To maintain a session as such for the above
1. I have "my" SessionManager class which creates and gives a unique session
id to the user when he logs in...
This I presently store in the HttpSession Object of the response, hence for
every request I get a sessionID from the HttpSessionObject. Mind you this is
a sepearate session id than the one you get from the HttpSession getId.
2. Simultaneously I maintain the id in "my" SessionManager Object with other
relevant information, and a thread keeps running to remove the ids after a
specific time - Session Logout.
3. For every request I verify/validate the user, depending on his id with
the one with the SessionManager.
Note : this works for browsers accepting and setting cookies.
The remedy to support all browsers would be to use urlEncode method to
encode the urls.
Performance-wise I think this is a better option for a small number of
users, or else the SessionManager object could cause a bottleneck for a
large number of ideas.
Hope it helps,
Yogesh
> -----Original Message-----
> From: Goh Boon Seng [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, April 05, 2000 3:06 PM
> To: [EMAIL PROTECTED]
> Subject: Re: any suggestions for global session
>
> Try creating a serlvet that gets initialized when the server is started.
> This
> serlvet will keep track of all session ID and provides methods for your
> login
> serlvets to query and update.
>
> ----- Original Message -----
> From: Krishna Kamath <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, April 05, 2000 4:31 PM
> Subject: any suggestions for global session
>
>
> > Hi,
> > I have a problem of session maintenance,I would like to know how
> > tomaintain a global sesion object
> > which can be accessed by all the requests from many clients(browsers).
> > For ex.
> > If a user logins into the application from one browser instance i have
> to
> > store
> > his id in a session so that the concurrent
> > logins from another browser instance or from any other machine should
> give a
> > simultaneous login .....by getting
> > the userid from the session.
> > we are using
> >
> > weblogic 5.0 B2
> > Servlet 2.2
> >
> > Thankyou
> > Kamath Krishna
> >
> >
> __________________________________________________________________________
> _
> > 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
> >
>
> __________________________________________________________________________
> _
> 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
___________________________________________________________________________
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