when will cookie information destroy?

Answer Posted / balakrishna

cookie is a"small amount of data" that is set by the server
on the client.

we have setmaxAge() for destroy cookie.

1.cookie.setMaxAge(100)-->100 sec
If we set the max age of a cookie to 100 sec,the browser
holds the cookie for 100 sec even if we close the browser.

2.If we set max age value to negative value the browser hold
the cookie till we close the browser.

3.If we use setMaxAge(0) the browser will arase the cookie.

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a servlet-to-servlet communcation?

635


What do you mean by annotations in servlet?

574


What is URL Encoding?

609


Can you refresh servlet in client and server-side automatically?

604


Is that servlet is pure java object or not?

628






What is context in servlet?

531


What is called Session Tracking?

589


What are the types of servlets? Explain

662


Write a command to get actual path of a servlet to the server?

528


What are the drawbacks of cgi?

556


Which event is fired at the time of session creation and destroy?

857


Which protocol will be used by browser and servlet to communicate

570


What is cookie in servlet?

583


What’s the difference between sendredirect and forward methods

555


What is the purpose of dispatcherservlet properties?

501