How do you create a permanent cookie?
Answers were Sorted based on User's Feedback
Answer / rahul garad
You can set the permanent cookied by setting the expiry
date to the MaxDate
<%
Response.Cookies("username") = "you"
Response.Cookies("username").Expires = Date.MaxValue
%>
| Is This Answer Correct ? | 70 Yes | 2 No |
Answer / ajinkya
<%
Response.Cookies("username") = "you"
Response.Cookies("username").Expires = Date.MaxValue
%>
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / naseem malik
If You want to Create a parament Cookies. you Permanent cookies are available until a specified expiration date, and are stored on the hard disk.So Set the 'Expires' property any value greater than DataTime.MinValue with respect to the current datetime. If u want the cookie which never expires set its Expires property equal to DateTime.maxValue.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / bhim bharti
Permanent cookies are available until a specified expiration date, and are stored on the hard disk.So Set the 'Expires' property any value greater than DataTime.MinValue with respect to the current datetime. If u want the cookie which never expires set its Expires property equal to DateTime.maxValue.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / 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 |
Answer / laki
we can create a permanent cookies giving the expiry date .
So Set the 'Expires' property any value greater than
DataTime.MinValue with respect to the current datetime. If
u want the cookie which never expires set its Expires
property equal to DateTime.maxValue.
| Is This Answer Correct ? | 7 Yes | 8 No |
Answer / sapna
Cookie is like a temporary file which contains a name and a
value pair and resides in the client.
cookie prepared or modified by the server side script will
be appended to the response and will be sent to the client.
dim cook as httpcookie
cook=new httpcookie("items")
cook.value=textbox1.text
response.appendcookie(cook).
| Is This Answer Correct ? | 13 Yes | 15 No |
Answer / shwetha
by setting the expiry property greater than
datetime.minvalue...
| Is This Answer Correct ? | 10 Yes | 13 No |
Explain what benefit does your code receive if you decorate it with attributes demanding specific security permissions?
Why we go for mvc instead of asp.net? : Asp.Net MVC
What is sdlc process?
What is a web api? Which protocol is used in a web api?
They mostly asked difference between versions of technologies
Are cookies stored on server or client?
Is asp.net still used?
What is the use of @Register directives?
how we Creating a Web Service
Describe the Server Control Events of ASP.NET?
0 Answers SwanSoft Technologies,
Hi please tell me what is ISNOTPOSTBACK,POSTBACK,AUTOPOSTBACK and also the extensions of aspx,asmx,ascx its urgent plz reply me soon....
Page Life Cycle in ASP.NET
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)