Link to home
Start Free TrialLog in
Avatar of Rocking
Rocking

asked on

configure JSESSIONID

Hi,

I have seen in many application where after the url there is string appended "JSESSIONiD".
what are the steps to configure "JSESSIONID" in tomcat?
ASKER CERTIFIED SOLUTION
Avatar of rrz
rrz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rocking
Rocking

ASKER

are there any configuration in server also for jsession id?
You could set the <session-timeout> in your web app's web.xml  .   But the session tracking mechanisms are built-in.
Avatar of Rocking

ASKER

I mean to say other than coding is there any way for configuring jsession id in tomcat?
What properties do you want to configure?  Are you talking about the tracking mechanisms?
Avatar of Rocking

ASKER

yes
I mean to say other than coding is there any way for configuring jsession id in tomcat?
No. It is like I posted above here. Did you try my demonstration JSP? If you don't encode your links, then url rewriting won't work. If the client uses a session cookie, then Tomcat won't use url rewriting. When the session is new, Tomcat uses both because it doesn't know whether the client will accept the cookie. Please try my demonstration JSP.
Avatar of Rocking

ASKER

If the client does not allow a session cookie
In case client allows cookie then what is the procedure?
In case client allows cookie then what is the procedure?
If the client allows a session cookie, then the programmer doesn't have to do anything to track the session. In a JSP, the session is automatically created. The programmer would have to purposely prevent creation of a session by adding session="false" to the page directive. A JSP can access the implicit variable named session.  In a Servlet, the programmer must purposely create the session. The HttpServletRequest class has methods to create and access  the session.