Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Handling cookies Path for specific subdomain ?

 
Albert Kam
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I would like to achieve 2 sessions (2 cookies) for each of the URL :
http://myhost/my_struts_app
and
http://myhost/my_struts_app/my_struts_submodule

Is there anyway i can achieve this using struts (either in version 1 or 2) ?

Because i found this line :
Cookies can also be limited in scope to a specific domain, subdomain or path on the web server which created them.
in http://en.wikipedia.org/wiki/HTTP_cookie

If this is achievable, then i can use 2 tabs in a single instance of firefox, to access those 2 URLs, without having to setup different firefox profiles

Please help ..

Thank you,
Albert Kam
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two cookies != two sessions: you'll still be in the same HTTP session.

Setting cookies isn't particularly Struts-specific; I don't recall what support, if any, S1 has for cookie handling. S2 has a CookieAware interceptor (or something like that) that'll put a map of cookies into an action.

I'm not sure that it's going to do what you think it's going to do, though.
 
Albert Kam
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear David,

Thank you for your reply.

Regards,
Albert Kam
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic