How do you create a permanent cookie?

Answer Posted / preeti

Permanent cookies are the ones that are most useful. Permanent cookies are available until a specified expiration date, and are stored on the hard disk. The location of cookies differs with each browser, but this doesn’t matter, as this is all handled by your browser and the server. If you want to create a permanent cookie called Name with a value of Nigel, which expires in one month, you’d use the following code
Response.Cookies ("Name") = "Nigel"
Response.Cookies ("Name"). Expires = DateAdd ("m", 1, Now ())

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does http session work?

518


What are the differences between the response.write() and response.output.write()?

529


What is session authentication?

528


What is the Difference between MVC And MVP design pattrens

2201


Can we use MSSql as backend in asp.net...if yes then How.?

581






What is directive in asp net?

537


What are client activated objects and server activated objects?

512


Can you change a Master Page dynamically at runtime?

572


What is the difference between trace and debug in asp.net?

610


Difference between DataGid and Girdview? Difference b/w .Net 2.0, 3.0 and 3.5 ? Diff b/w dispose & Finialize Methods?

2019


Explain transparent caching with aop?

517


In which event of page cycle is the viewstate available?

574


Explain about asp.net state management?

610


What is enableviewstate in asp net?

518


How to disable validator control by client side JavaScript?

567