Solved

cookie issue

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 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