Strange Cookie problem!

J

jensen bredal

the code below works as expected when i'm doing localhost developpement on
my win xp pro
but when moved onto production server( windows 2003 server) and viewing from
my win xp pc, then UserIndexA is always ==null.
Note that the page does a refresh every minute.

Are some of the calls failing on windows 2003 server???

Any help will be higly appreciated.

*********************

if (Request.Browser.Cookies)
{

try
{
HttpCookie UserIndexA=Request.Cookies["UserIndexA"];

if (UserIndexA == null)
{

UserIndexA = new
HttpCookie("UserIndexA",UserSettings.GetPacketSize(HttpContext.Current.User.Identity.Name).ToString()
);
UserIndexA.Expires = DateTime.Now.AddMinutes(3);



Response.Cookies["UserIndexA"].Value=UserSettings.GetPacketSize(HttpContext.Current.User.Identity.Name).ToString();

Response.Cookies.Add(UserIndexA);
}
else
{

UserIndexA=Request.Cookies["UserIndexA"];


int index =int.Parse(Request.Cookies["UserIndexA"].Value);


Response.Cookies["UserIndexA"].Value=index.ToString();
Response.Cookies["UserIndexA"].Expires=DateTime.Now.AddMinutes(3);
}


JB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top