Solved

cookie issue

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 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

13 Experts available now in Live!

Get 1:1 Help Now