Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Permanent cookie  RSS feed

 
Y M S Reddy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a requirement to create a permanent cookie, which retains the state in different webapplications.


new Cookie("userid",state)
response.addCookie()

This only works for one webapplication. I am able to get the value in different pages in the same webapplication.

Is there a solution for retaining the cookie value in different webapplications in an Application

I appreciate your help

Thanks in advance
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Is there a solution for retaining the cookie value in different webapplications in an Application


Could you explain that in more detail?
 
Y M S Reddy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

My application contains many webapps.I have to retain TimeZone value of the user in every page the user browses.He can first go to a webpage in one webapplication and select the TimeZone. This value has to be stored in a cookie and when the user browses to another webpage in a different webapp this value has to retained.

When the user first selects the TimeZone from the Front End Page I am
adding this to a cookie using
say
Cookie c=new Cookie("TimeZone","Pacific");
c.setMaxAge(n); where n is some large number.
and response.addCookie(c);

If I use a different page in the same webapp, I am able to get the Cookie value, but If I am trying to get the cookie vaue in a different webapp I am not able to retrieve the Cookie value.

Hope I am clear .
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!