Solved

cookie issue

Posted on 2004-04-16
3
176 Views
Last Modified: 2010-04-15
I have an aspx page called from an asp page.

When the aspx page is not spawned in a new window, everything works just fine.

However, when that same aspx page opened up in a new window. I am losing the cookies and their values are not being found?  I am not sure where the hole is when spawing this new window and its driving me crazy!

THis is in II6.  Here is my cookie code in the aspx code behind.     Thanks, jrmcdona

                  Response.Expires=-1;


                  HttpContext ctx = HttpContext.Current;
                  // Read the cookie
                  HttpCookie inCookie = ctx.Request.Cookies["9JHS7"];

                  if(inCookie != null)
                  {
                        ID1.Text = "Cookie value: " + inCookie.Values["ID1"].ToString();
                        ID2.Text = "Cookie value: " + inCookie.Values["ID2"].ToString();
                        ID3.Text = "Cookie value: " + inCookie.Values["ID3"].ToString();
                  }    
0
Comment
Question by:jrmcdona
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
glsac earned 250 total points
ID: 10849661
if(inCookie != null)


After that could you do a Response.Write : Cookie not Found...else get the values? I bet it is not finding the cookie.

Last week I had a similiar problem, strangly enough I found the error to be that the cookie it was looking for was a localhost cookie, while the original cookie from an ASP page (that I was looking for...same idea as you), was not a localhost cookie...when deployed it read it fine, locally on my machine it did not work.

-Joe
0
 

Author Comment

by:jrmcdona
ID: 10849848
Well I was opening the the file in a new window and that is where it lost the cookies. I simply stopped opening the report in a new window and it solved the problem. I dont why that is happening but it is!

thanks, jrmcdona
0
 
LVL 9

Expert Comment

by:glsac
ID: 10849862
That is really odd...ok happy ya got it!
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question