This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Servlets and the fly likes Cookie Code Not Working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Cookie Code Not Working" Watch "Cookie Code Not Working" New topic
Author

Cookie Code Not Working

Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 515
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.


By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)
Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 515
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.
 
GeeCON Prague 2014
 
subject: Cookie Code Not Working