Solved

cookie issue

Posted on 2004-04-16
3
175 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now