This is a discussion on Store and Retrieve the values in cookies in ASP.NET within the ASP and ASP.NET Programming forums, part of the Web Development category; Objective: Store and Retieve cookies in ASP.NET Steps: Store and Retieve cookies quite simple in ASP.NET.please follow ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Objective: Store and Retieve cookies in ASP.NET Steps: Store and Retieve cookies quite simple in ASP.NET.please follow the below steps Store values to cookie ---------------------- HttpCookie objCookie = new HttpCookie("Newcookiename"); Response.Cookies.Add(objCookie); objCookie.Values.Add(cookiename,"2007"); DateTime dtExpiry = DateTime.Now.AddYears(1); Response.Cookies[cookiename].Expires =dtExpiry; Retrieve values from cookie --------------------------- string temp = (Request.Cookies["Newcookiename"].Value) ; Note:if there is no values in the cookie then it will return null. |
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to getting values from cookies to set widgets? | GDevakii | HTML, CSS and Javascript Coding Techniques | 1 | 10-30-2007 02:29 AM |
| How do I retrieve the values from the URL? | Pvinothkumar | HTML, CSS and Javascript Coding Techniques | 1 | 09-13-2007 06:30 AM |
| Store and retrive flash cookies | oxygen | Flash Actionscript Programming | 4 | 08-22-2007 11:58 PM |
| how to store and retrieve data from cookies | hanusoftware | ASP and ASP.NET Programming | 1 | 08-09-2007 07:17 AM |
| How to Store and Retrieve the values in server side caches in ASP.NET? | oxygen | ASP and ASP.NET Programming | 1 | 07-23-2007 01:14 AM |