This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Servlets and the fly likes Question on Cookie Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Question on Cookie" Watch "Question on Cookie" New topic
Author

Question on Cookie

Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 558


Hi Ranchers,

Statement: A cookie stores information about the server on client side(browser.)

Scenario :With the above Statement being true, Suppose assume the Client(browser) rejects to create a cookie on client side,how will the server know that client has rejected to create a cookie on client side.
How do we handle this scenario in case of Cookies.

Please help me out to handle the above scenario.

Help provided will be highly appreciated.

--
Deepak Lal


When The Going Gets Tougher,The Tougher gets Going
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63227
    
  69

If the cookie is not created on the client, the only way that the server can know is to try to read it.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Check if cookie is present in HttpServletRequest#getCookies() of subsequent request or not.
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 558

Hi Bear,
Can i have a sample logic for the same.Im trying to work on this for quite a while sometime but finding it difficult to accomplish.

If you could provide me with a Sample code logic ,it will be appreciated in order to understand the concept better.

--
Deepak Lal
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
You missed my reply?
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 558



Awesome Reply Bauke Scholtz and Bear.

Thanks Ranchers for your valuable input/answers.



Thanks for the valuable input provided.

--
Deepak Lal

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
You´re welcome.

In the future, please omit those unnecessary colors in your posts.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Question on Cookie
 
jQuery in Action, 3rd edition