ASP.NET 2.0 Question:
Download Job Interview Questions and Answers PDF
How do you create a permanent cookie?
Answer:
Setting a permanent cookie is similar to Session cookie, except give the cookie an expiration date too. It is very common that you don't specify any arbitrary expiration date, but instead expire the cookie relative to the current date, using the DateAdd() function.
Response.Cookies("Name") = "myCookie"
Response.Cookies("Name").Expires = DateAdd("m", 1, Now())
by expiration date in cookie tag...
Response.Cookies("Name") = "myCookie"
Response.Cookies("Name").Expires = DateAdd("m", 1, Now())
by expiration date in cookie tag...
Download ASP.NET 2.0 Interview Questions And Answers
PDF
Previous Question | Next Question |
Where would you use an iHTTPModule, and what are the limitations of any? | Explain What are delegates? |