You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by lightbulb432 <ve...@hotmail.com> on 2007/10/04 05:35:25 UTC

Implementing HttpSession

Rather than using Tomcat's own HttpSession, I may be implementing HttpSession
to write to shared storage or to the client. (Or if for no other reason,
then to learn something.)

Do you know of any HttpSession implementations that are publicly available,
as the task of storing session state in places other than web server memory
is common enough that I'd hope others have already done so? A quick web
search didn't reveal anything too exciting.

There are a couple of methods I'm having trouble understanding how to
implement. The first is isNew(). Looking through the StandardSession code, I
can't tell exactly when to set this to true and false - all I know is that
initially upon session creation on the server (e.g. in
ManagerBase.createSession()), the "new" property is set to true. In what
cases is it set to false, and how would a web application developer use this
method?

How can you tell Tomcat to use your implementation of HttpSession, so that
when you call request.getSession(), it returns that object?

In the above case, would Tomcat take care of calling setMaxInactiveInterval
and providing a value for getServletContext()?

Thanks.
-- 
View this message in context: http://www.nabble.com/Implementing-HttpSession-tf4565627.html#a13032004
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Implementing HttpSession

Posted by Tim Funk <fu...@joedog.org>.
For a different session implementation than StandardSession :
http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html

It is a JDBC based version of storing an HttpSession.

-Tim


lightbulb432 wrote:
> Rather than using Tomcat's own HttpSession, I may be implementing HttpSession
> to write to shared storage or to the client. (Or if for no other reason,
> then to learn something.)
> 
> Do you know of any HttpSession implementations that are publicly available,
> as the task of storing session state in places other than web server memory
> is common enough that I'd hope others have already done so? A quick web
> search didn't reveal anything too exciting.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Implementing HttpSession

Posted by Mark Thomas <ma...@apache.org>.
lightbulb432 wrote:
> There are a couple of methods I'm having trouble understanding how to
> implement. The first is isNew(). Looking through the StandardSession code, I
> can't tell exactly when to set this to true and false - all I know is that
> initially upon session creation on the server (e.g. in
> ManagerBase.createSession()), the "new" property is set to true. In what
> cases is it set to false, and how would a web application developer use this
> method?

See SRV.16.1.7 (towards the end of the section) for this

> How can you tell Tomcat to use your implementation of HttpSession, so that
> when you call request.getSession(), it returns that object?

Write your own manager implementation.

> In the above case, would Tomcat take care of calling setMaxInactiveInterval
> and providing a value for getServletContext()?

Nope.

Mark

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org