Showing posts with label Cookies. Show all posts
Showing posts with label Cookies. Show all posts

Tuesday, 18 November 2014

How To Use Cookies ASP.NET.

Cookies provide the ability to store small amounts of data on a clients machine. It is often used to store user preferences, session variables, or identity. When the user visits your Web site another time, the application can retrieve the information it stored earlier.
The browser is responsible for managing cookies on a user system. Cookies can be created, accessed, and modified directly by script running on the client and pass between the client and server during requests.
Writing code in C#
Response.Cookies["UserName"].Value = "Ashok";
Response.Cookies["UserName"].Expires = DateTime.Now.AddDays(1);

Copyright © DotNet-Ashok