How do you create a permanent cookie?

Answers were Sorted based on User's Feedback



How do you create a permanent cookie?..

Answer / surya beniwal

write this cod on submit button : ..........

HttpCookie objCookie = new HttpCookie("UserCookie");
objCookie.Values.Add("UserName", TextBox1.Text);
objCookie.Values.Add("UserPass", TextBox2.Text);

//for permanent cookie .......
objCookie.Expires = DateTime.MaxValue;

Response.Cookies.Add(objCookie);

Response.Redirect("Default2.aspx");

Is This Answer Correct ?    7 Yes 1 No

How do you create a permanent cookie?..

Answer / vimal

by setting the expiry property greater than
datetime.minvalue.....

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

Explain client side state management system.

0 Answers  


Explain the main function of url routing system in asp.net mvc? : asp.net mvc

0 Answers  


Which is the parent class of the web server control?

0 Answers  


what is the MSIL assembler do?

1 Answers  


In which event of the page life cycle, is the viewstate available?

0 Answers  






You have been given the task of designing a web services to expose the data that is stored in a database on the server. In order to successfully build the web services, you need to import some namespaces. What is the minimum namespace you need to import? a) System.Web b) System.WebServices c) System.Web.Services d) System.Web.ServiceModel

2 Answers   Syntax Softtech,


Types of exceptions in dot net???

1 Answers   TCS,


How many classes can a single .NET DLL contain?

2 Answers  


What is the use of @Register directives?

3 Answers  


What are the advantages of the code-behind feature?

0 Answers  


What Are Different Types of Debbugers

2 Answers   Accenture, TCS, Wipro,


You create an assembly to access data in a relational database. This assembly will be used by several ASP.NET applications on your Web server. You need to ensure that all your applications can access the assembly. Which two actions should you take (Each Answer: presents part of the solution.)? (Choose two) A . Run the Assembly Registration tool (Regasm.exe). B . Run the String Name tool (Sn.exe). C . Run the Installer tool (Intallutil.exe). D . Run the Global Assembly Cache tool (Gacutil.exe).

6 Answers   CPCL, Syntax Softtech,


Categories