Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

cookie issue

Posted on 2004-04-16
3
Medium Priority
?
183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
glsac earned 750 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

670 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