aspose file tools
The moose likes Struts and the fly likes no cookie Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "no cookie" Watch "no cookie" New topic
Author

no cookie

Gigi Kent
Ranch Hand

Joined: Nov 30, 2004
Posts: 40
Hello.
Does anybody knows if it is possible to deactivate cookie for struts so struts will keep session track only on the server and not on the client side?(and it will rewrite all the link automaticaly).
Now struts check to see if the browser support cookie and if so it uses cookie.
If browser is not supporting cookie, it uses session stored on the server.
I want to keep the session only on the server side.
Thank you.
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1005
I think you misunderstand it a little.
You seem to think that the session is stored client side with cookies.
This is not true. Cookies or not, the session is stored on the server.
The question is just how you tell the server what your sessionId is.

If you have cookies enabled, it stores the session id in the cookie. (only the id, nothing else)
Otherwise it encodes the session id with every URL.

This isn't a struts functionality but rather a standard servlet functionality defined in the servlet spec/API. You use the method response.encodeURL() and it decides if the session id needs to be added to the URL or not.

Cheers,
evnafets
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: no cookie
 
Similar Threads
please tell me when to use Session and Cookie?
session in servlet
HFSJ Page 231, under 2nd Heading
Do I need to "add" encodeURL for "action" tag in this case ?
Newbie to JSP, multiple user login problem