File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes change cookie value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "change cookie value" Watch "change cookie value" New topic

change cookie value

Amy Saari
Ranch Hand

Joined: Sep 13, 2007
Posts: 30
For those of you having trouble with this. Make sure you put the cookie on the response - even if you're just changing the value. And make sure you have the path correct - if you want the cookie sent on any request to that domain set the path as /. And then make sure you set the maxLength is you want your cookie to stay around after the session.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63866

Is there a question in there somewhere?

[Asking smart questions] [About Bear] [Books by Bear]
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3381

That's nice "A Saarii". Thank you

You have to update your display name so as to match with Ranch's Naming Policy. You may please have a look at the Naming Policy here.

You can update your name by editing your profile. It does NOT affect any of your earlier threads except the display name gets updated everywhere.

Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3381

Originally posted by Bear Bibeault:
Is there a question in there somewhere?

Bear, i dont know whether this is allowed or not.

It looked like as such he had some information to share.
I agree. Here's the link:
subject: change cookie value
It's not a secret anymore!