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

Cookie Code Not Working

 
Dale DeMott
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to read and write a cookie. I'm doing this within the action in struts. The code that writes the cookie looks like this...



As you can see.. the last line is doing a findForward because this is inside of an action within struts. For some reason this isn't writing any cookies. Other cookies can be written to my system. I've checked where the cookies are stored and saw other cookies and other valeus being written so it isn't my browser settings. I've looped through all of the cookies in the system. The only cookie that shows up is a JSESSSION cookie



Any help would be appreciated.
 
Dale DeMott
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found this to be some problem w/ the domain and the path. When I removed the domain and path, the cookie wrote fine. Not sure why. When this goes to production though it will definitely have to have the domain and path in place.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic