FAQs
Search
Recent Topics
Flagged Topics
Hot Topics
Best Topics
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Paul Clapham
Ron McLeod
Bear Bibeault
Liutauras Vilda
Sheriffs:
Jeanne Boyarsky
Tim Cooke
Junilu Lacar
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Jj Roberts
Carey Brown
Bartenders:
salvin francis
Frits Walraven
Piet Souris
Forum:
Java in General
Cookie not set
Miran Cvenkel
Ranch Hand
Posts: 233
2
posted 1 week ago
Pretty much sure this code works on production server, not on localhost. Checking in firefox storage, nothing. Any idea ?
Cookie myCookie = new Cookie(CookieName, CookieValue); myCookie.setMaxAge(duration_in_days * SECONDS_PER_DAY); response.addCookie(myCookie);
Searchable nature photo gallery:
http://agrozoo.net/jsp/Galery.jsp?l2=en
Miran Cvenkel
Ranch Hand
Posts: 233
2
posted 1 week ago
the problem was response.isCommitted() being true
caused by flush = true
<jsp:include page="..." flush="true" />
Searchable nature photo gallery:
http://agrozoo.net/jsp/Galery.jsp?l2=en
Miran Cvenkel
Ranch Hand
Posts: 233
2
posted 1 week ago
still strange I did not t change that flush code on workig server and there it works. Maybe tomcat6 vs tomcat8 = work/does not work .....
Searchable nature photo gallery:
http://agrozoo.net/jsp/Galery.jsp?l2=en
Stephan van Hulst
Saloon Keeper
Posts: 12605
273
posted 1 week ago
1
Be happy you could produce a problem on your development machine. I usually have the opposite problem where an issue appears on a production machine, but not on my development box.
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
cookie does not stick on localhost
Cookies not getting stored in IE6 and IE7 when running in environment resembling production
Cookies not getting reset in Netscape 4.72!!! URGENT!!!
How to set httponly to false for a secure cookie in servlet2.5
Using a method to retrieve a cookie
More...