Used Namespaces
using
System;
using
System.Collections.Generic;
using
System.Collections.Specialized;
using
System.Web;
Usage of Multiple values Cookie
Dictionary<string,
string> keyVal = new
Dictionary<string,
string>();
keyVal.Add("FirstName",
"Lajapathy");
keyVal.Add("LastName",
"Arun");
StateManagement
stateManagement = new
StateManagement();
stateManagement.SetMultipleUsingSingleKeyCookies("Data",
keyVal);
keyVal = stateManagement.GetMultipleUsingSingleKeyCookies("Data");
Creating Http request
public
static HttpRequest
GetHttpRequest()
{
return
HttpContext.Current.Request;
}
Creating http response
public
static HttpResponse
GetHttpResponse()
{
return
HttpContext.Current.Response;
}
Getting single value from the cookie
public
string GetIndividualCookies(string
cookieKey)
{
return
GetHttpRequest().Cookies[cookieKey].Value;
}
Setting single value to the cookie
public
void SetIndividualCookies(string
name, string value)
{
GetHttpResponse().Cookies[name].Value = value;
}
Getting multiple values from single cookie
public
Dictionary<string,
string> GetMultipleUsingSingleKeyCookies(string
cookieName)
{
//creating dic to return as collection.
Dictionary<string,
string> dicVal = new
Dictionary<string,
string>();


Jason MirandaPosted Mar 27, 2014, 5:29 PM
Where is this class defined? StateManagement stateManagement = new StateManagement();
Kumar SambhavPosted Sep 13, 2012, 7:48 AM
Thank You Sir .........