top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

How to create custom session and cookie in Tomcat 7/8 ?

+1 vote
94 views

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?).

posted Sep 8, 2013 by Sumit Pokharna

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

2 Answers

+1 vote

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

answer Sep 8, 2013 by Amit Parthsarthi
I need to be more dynamic. I need to be able to setthe session name and domain based on the url.
+1 vote

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?

answer Sep 8, 2013 by Sanketi Garg
Similar Questions
+1 vote

I think we can do it through the web.xml file located in tomcatconfweb.xml and then restart Tomcat.

Is there a difference if I change it in the tomcatconf location versus tomcatwebapps[web app name] web-infweb.xml location?

If I change the web.xml file in the tomcatconfweb.xml location will it override the web app location?


Useful Links with Similar Problem
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#470/147, 3rd Floor, 5th Main,
HSR Layout Sector 7,
Bangalore - 560102,
Karnataka INDIA.
QUERY HOME
...