users@glassfish.java.net

Re: Glassfish web container session control

From: Wolfram Rittmeyer <w.rittmeyer_at_jsptutorial.org>
Date: Mon, 23 Mar 2009 23:35:43 +0100

glassfish_at_javadesktop.org wrote:
> Hi all,
>
> I need to implement session control for one of my web applications hosted in glassfish. In specific, session timeout , user concurrent session and custom session id. Browsing through glassfish manuals, I cant find much information on these and i am totally new to web applications. Please help. Thanks in advance.

Hm. I'm not sure I understand the question but given that none has
answered yet, I nevertheless try to answers some points.

First of all: You can set the session timeout values either in web.xml
or programatically (session.setMaxInactiveInterval(timeInSeconds)). The
latter can also be used to change the default for individual sessions.

"User concurrent session"? Do you mean two sessions for the same user?
You have to take control of this yourself. Generally any session is
independent of any other session and thus two sessions of the same user
are possible and neither would influence the other. Problems do occur if
your browser keeps the same cookie for both sessions. In this case both
sessions would not be distinguishable for the container. You cannot
prevent this with standard sessions. You would have to create two
different conversations and pass some kind of conversation identifiers
with each request of one conversation. Seam and I think the coming web
beans specification (now renamed but you will fine anything you need to
know by googling webbeans) have something like this.

Now this probably left a lot of questions open, given that I did not
exactly get your problem. So just keep asking ;-)


--
Wolfram Rittmeyer
> 
> Regards,
> Pedric
> [Message sent by forum member 'pedric' (pedric)]
> 
> http://forums.java.net/jive/thread.jspa?messageID=338396