Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJWCD
Search Coderanch
Advance search
Google search
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
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Web Component Certification (OCEJWCD)
Programmatically removing a cookie
MalanS Subramanian
Greenhorn
Posts: 8
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Ranchers,
Is it possible to programatically remove a cookie? I tried looking in
Servlet
API and couldnt find any...
Thanks in advance
Chinmaya Chowdary
Ranch Hand
Posts: 437
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Malan. Can you please tell, in which situations this behaviour is needed? Thankyou.
SCJP5.0, SCWCD5.0, OCEJPAD6, OCPJWSD6
MalanS Subramanian
Greenhorn
Posts: 8
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Chinmaya,
I dont have any situations as such in my mind, but was just wondering whether this is doable.
Chinmaya Chowdary
Ranch Hand
Posts: 437
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Malan. Thanks for the reply. There is no remove method available in Servlet api. If we want to restrict particular client we can follow better alternatives, like filtering. As far my knowledge concerned, this behavior is not needed.
SCJP5.0, SCWCD5.0, OCEJPAD6, OCPJWSD6
Sebastian Janisch
Ranch Hand
Posts: 1183
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
It is possible to remove a cookie, you just need a little workaround.
Retrieve the cookie, set MaxAge to 0 and reinsert it.
JDBCSupport
-
An easy to use, light-weight JDBC framework
-
MalanS Subramanian
Greenhorn
Posts: 8
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Sebastian,
Thanks for the reply... thats a cute lil workaround
Sebastian Janisch
Ranch Hand
Posts: 1183
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Apart from being cute, it's pretty much the only way to remove a cookie from the server side,,,
JDBCSupport
-
An easy to use, light-weight JDBC framework
-
Listen. That's my theme music. That's how I know I'm a super hero. That, and this tiny ad told me:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Knowing status of Cookies
How do I get my current URL???
how to handle cookies using mock objects
setting cookies programatically
redirect to error page upon session timedout
More...