Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with Cookie?

 
Mallik Avula
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have a problem with cookie.
I created the cookie with name and value upon login and It is working fine.
The problem is, after login if member clicks on a anchor it is asking to login to see that page (If the page is only for members not for public).
That should not be the case. Because member is already logged in and she can see that page without re-login.

What i found is, in the browser the string it is using for the 'site' is example.com but not www.example.com.
if we open a page like
the browser is treating it as a new domain. that is why it is not sending the valid cookie (which created after member logged in)

How can I use the same cookie for example.com and www.example.com and http://www.example.com and http://example.com

I want to say all these are related to same domain.

Can any body help me to solve the problem.
 
Satya Maheshwari
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your browser accept cookies? You can check its security setting.
Did you consider using HttpSession?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what the Cookie.setDomain method does.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic