tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Want to customise the tomcat's session logic
Date Mon, 09 Nov 2009 22:44:51 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Arvind,

On 11/7/2009 11:35 PM, S Arvind wrote:
> is it possible to provide costume sessionid while creating session.? so that
> different time when session needs to be created i can create new sessionid
> and store it in cookie.

No, you can't customize the session id, but you can register a listener
that will be notified of session creation events:

http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/http/HttpSessionListener.html

Note that there aren't any objects available during this method that
will let you set a cookie on the request. For that, you could write a
Filter that wraps the request to intercept calls to getSession() and
make sure that, if a session is created, your cookies are written as well.

I wish you'd tell us what the heck you're trying to do because I'm
certain there's an easier way to do it.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkr4m2MACgkQ9CaO5/Lv0PCA+QCcCI3cfZTtJx9C4d1O/hvT+Rux
kLcAoLlTj04s7st0Sd4+B9rpx48TPVx8
=ZQDV
-----END PGP SIGNATURE-----

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


Mime
View raw message