You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Marc Boorshtein <mb...@gmail.com> on 2013/09/08 14:15:01 UTC

How to create custom session and cookie?

I'm trying to figure out how I can create custom session cookies.  I've
found the Manager interface for creating the sessions, but there's nothing
about the actual session cookie.  I don't see anything in the Valve
interface that will let me do this either.  Is this possible in Tomcat 7
(or 8?).

Thanks
Marc

Re: How to create custom session and cookie?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Marc,

On 9/8/13 10:34 AM, Marc Boorshtein wrote:
> On Sep 8, 2013 9:12 AM, "Michael-O" <19...@gmx.net> wrote:
> 
>> Am 2013-09-08 14:15, schrieb Marc Boorshtein:
>> 
>>> I'm trying to figure out how I can create custom session
>>> cookies.  I've found the Manager interface for creating the
>>> sessions, but there's nothing about the actual session cookie.
>>> I don't see anything in the Valve interface that will let me do
>>> this either.  Is this possible in Tomcat 7 (or 8?).
>>> 
>> 
>> What do you mean by custom? Change the cookie name? If yes, you
>> can do so: http://tomcat.apache.org/**tomcat-8.0-doc/config/** 
>> systemprops.html#Sessions<http://tomcat.apache.org/tomcat-8.0-doc/config/systemprops.html#Sessions>
>
>
>> 
I need to be more dynamic. I need to be able to setthe session name
> and domain based on the url.

Tomcat allows you to set the cookie name already, and the domain and
path depend upon the domain and path used by the webapp.

Perhaps it would be better to describe what Tomcat does *not* do that
you need it to do instead?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJSLPZMAAoJEBzwKT+lPKRYwFcQAIT2H7/EvbIGz1K04OKQXbLn
/SHD9+au/p3a1Movk0Zci8Y7YLggNRcgdnbFHVTMuLw2f/5EqfABXmQdAjkq1zIi
K4Fj3Aw27a/jrXQvn+hP14ee8wRoc+1pc6wFmEK3HhotilNUG+d1oQCDqka0ZuPn
hr/GFVIaX8/TG/AiQHTaXmTvhbvLSeEpwQ1hGgfJ0bsaKpldOmbxBQ45/RyF5r0w
sk4R4T3ljKhYEdvffb+LloV3pt/81oW0NNMeW4W/U73Y3uObf+Ph4NAk26cVGCvU
lJJaXc8g7wVlpcXFHjZZoMtNcRmDGWt3FA6mikwIxdyIgJS8TvwwxcSMCAU8nMY1
XCxwA6gFiU8DhWrKNi6hluPC6we0aeE9YcpcGSkq1rossZ8RDGJUKe751+gSq/wW
Zd/Esgx2kXgzT57rTOtySIpO4q0iCZsTPMPpZkBUuBxvnbAzinOBEPY4WjtnIbZJ
jBGqgoy/ph3LO52mItQ9RvrqKnQnulVx3hpKLu6RGOxdY7cJ/VOz/mLRBSlv6z6C
smIc4+/W0esN7UeeSeURz6Qk7upUsoZTak5Hc523M2hHXwWpTqVoWsC7GcCRaruU
M6MqfpUUtT5qHCFZafXCWuQtuTWGQvGSOT9QZq6fPZRA4sSgU6/vDFU+hOdaRRI1
+0k1t976VzOBdzPGxS5t
=/KVV
-----END PGP SIGNATURE-----

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


Re: How to create custom session and cookie?

Posted by Michael-O <19...@gmx.net>.
Am 2013-09-08 16:34, schrieb Marc Boorshtein:
> I need to be more dynamic. I need to be able to setthe session name and
> domain based on the url.
> On Sep 8, 2013 9:12 AM, "Michael-O" <19...@gmx.net> wrote:

1. Do *not* top-post!
2. Session name? You obviously mean session /cookie/ name. Make it clear.
3. The domain/URL is done by the container.

If need to modify the create cookie source, you should search the search 
code for and start with that.

Michael


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


Re: How to create custom session and cookie?

Posted by Marc Boorshtein <mb...@gmail.com>.
I need to be more dynamic. I need to be able to setthe session name and
domain based on the url.
On Sep 8, 2013 9:12 AM, "Michael-O" <19...@gmx.net> wrote:

> Am 2013-09-08 14:15, schrieb Marc Boorshtein:
>
>> I'm trying to figure out how I can create custom session cookies.  I've
>> found the Manager interface for creating the sessions, but there's nothing
>> about the actual session cookie.  I don't see anything in the Valve
>> interface that will let me do this either.  Is this possible in Tomcat 7
>> (or 8?).
>>
>
> What do you mean by custom? Change the cookie name? If yes, you can do so:
> http://tomcat.apache.org/**tomcat-8.0-doc/config/**
> systemprops.html#Sessions<http://tomcat.apache.org/tomcat-8.0-doc/config/systemprops.html#Sessions>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.org<us...@tomcat.apache.org>
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: How to create custom session and cookie?

Posted by Michael-O <19...@gmx.net>.
Am 2013-09-08 14:15, schrieb Marc Boorshtein:
> I'm trying to figure out how I can create custom session cookies.  I've
> found the Manager interface for creating the sessions, but there's nothing
> about the actual session cookie.  I don't see anything in the Valve
> interface that will let me do this either.  Is this possible in Tomcat 7
> (or 8?).

What do you mean by custom? Change the cookie name? If yes, you can do 
so: http://tomcat.apache.org/tomcat-8.0-doc/config/systemprops.html#Sessions


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