While using cookies, when the browser is shut down. will the data be available at next open of browser. If not available, how to over come that.

Questions by Srini99   answers by Srini99

Showing Answers 1 - 13 of 13 Answers

Kumar

  • Aug 21st, 2006
 

Ofcourse it will be available. The timeout of cookies is in no way related to the killing of a browser window.

  Was this answer useful?  Yes

S

  • Aug 24th, 2006
 

Per session cookies will be lost if the browser is closed

  Was this answer useful?  Yes

tygrabbit

  • Sep 2nd, 2006
 

Cookie, a small amount of information set and sent by server to web browser. It's stored in web browser used to uniquely identify a client. Cookie is often used for session management.

after creating a cookie, there're some optional attributes to be set for it.

Cookie cookie = new Cookie("name", "value");

cookie.setMaxAge(intInSeconds);

if intInSeconds is negative, or if no maxAge is set, then cookie will be not be persisted to broswer and will be deleted when browser is closed.

  Was this answer useful?  Yes

Deepesh

  • Oct 5th, 2006
 

Hi all,

I just want to say.

people give their answers here but some answers have contradict to each other.

so for a beginner in Java who is learning, which answer should he follow.

Please give me the reply as soon as.

Thanks !! 

  Was this answer useful?  Yes

kasim

  • May 26th, 2007
 

this is a good question, understand both what they are trying to say, do research, then you can identify the correct answers.

  Was this answer useful?  Yes

pdommara

  • Sep 16th, 2010
 

Hi guys, Thanks for  your answers, but no one could not able to answer exactily. Here my try is  :

We can use cookies to store the permenentily  at browser by setting cookie.setmaxAge(0) that measn user need to  manullay delete the cookies at browser.

If the user close the browser also, cookie info will be stored at  browser.

A positive value indicates that the cookie will expire after that many seconds have passed. Note that the value is the maximum age when the cookie will expire, not the cookie's current age.

A negative value means that the cookie is not stored persistently and will be deleted when the Web browser exits. A zero value causes the cookie to be deleted.

Thanks.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions