Cookie
How we can retrieve cookies stored in system, I need a asp.net program to retrieve existing cookies from system and also when we enter information like user name password in system it will be saved in system and later if i want to retrieve. it could be retrieve. reply as soon as possible.
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Former memberPosted Apr 15, 2012, 11:06 PM EDT
http://www.c-sharpcorner.com/uploadfile/puranindia/cookies-in-Asp-Net/
http://www.c-sharpcorner.com/UploadFile/Vipul.Kelkar/working-with-cookies-in-Asp-Net/
http://www.c-sharpcorner.com/uploadfile/annathurai/cookies-in-Asp-Net/default.aspx
sunakshi saxena36 pointsPosted Apr 16, 2012, 3:09 AM EDT
Abhimanyu K VatsaRank #14 · 51.6K pointsPosted Apr 16, 2012, 11:25 AM EDT
SenthilkumarRank #387 · 6.5K pointsPosted Apr 16, 2012, 8:14 PM EDT
In the ASP.Net server side,
int loop1, loop2;
HttpCookieCollection MyCookieColl;
HttpCookie MyCookie;
MyCookieColl = Request.Cookies;
// Capture all cookie names into a string array.
String[] arr1 = MyCookieColl.AllKeys;
// Grab individual cookie objects by cookie name.
for (loop1 = 0; loop1 {
MyCookie = MyCookieColl[arr1[loop1]];
Response.Write("Cookie: " + MyCookie.Name + "
");
Response.Write ("Secure:" + MyCookie.Secure + "
");
//Grab all values for single cookie into an object array.
String[] arr2 = MyCookie.Values.AllKeys;
//Loop through cookie Value collection and print all values.
for (loop2 = 0; loop2 {
Response.Write("Value" + loop2 + ": " + Server.HtmlEncode(arr2[loop2]) + "
");
}
}
Reading all the cookies in client side javascript,
For more info:
http://www.tutorialspoint.com/javascript/javascript_cookies.htm
http://stackoverflow.com/questions/8315251/how-can-i-get-cookies-from-httpclienthandler-cookiecontainer
http://www.electrictoolbox.com/javascript-get-all-cookies/
lakshmipathi vemula20 pointsPosted Apr 16, 2012, 11:50 PM EDT
http://www.bestdotnettraining.com/Online/Training/ASP-NET/ASP-NET-State-Management-/51