Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on Cookie

 
Deepak Lal
Ranch Hand
Posts: 561
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64633
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the cookie is not created on the client, the only way that the server can know is to try to read it.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check if cookie is present in HttpServletRequest#getCookies() of subsequent request or not.
 
Deepak Lal
Ranch Hand
Posts: 561
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You missed my reply?
 
Deepak Lal
Ranch Hand
Posts: 561
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You´re welcome.

In the future, please omit those unnecessary colors in your posts.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic