0

I'm using VS 2010, vb.net and asp 3.5. I have a simple default.aspx page that has

   Dim ctx As HttpContext = HttpContext.Current
   Dim cookie As HttpCookie = ctx.Request.Cookies("SessionGUID")
   Me.lbl1.Text = cookie.Value.ToString

the page loads fine when running it from within VS, but when i build the site and run the page, it doesn't load.. it doesn't give me an error, but nothing shows up.

This is what the view source looks like

HTML>HEAD> META content="text/html; charset=windows-1252" http-equiv=Content-Type>/HEAD> BODY>/BODY>/HTML>

I took out the < in the tags so that it would display here...

If i take out the Me.lbl1.Text = cookie.Value.ToString the page loads fine.. All i'm putting to the page is some text and the label control.

anyone have any ideas

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
jvcoach23
  • 2,765
  • 10
  • 34
  • 50
  • putting a try and catch in the lbl1.text=cookie.value.tostring i see that when running in visual studio, the cookie value comes back correctly, when it's published and running in IIS, the cookie is never created. are there permissions or something to have them get created when running outside of Visual Studio? – jvcoach23 Apr 22 '10 at 15:38

1 Answers1

0

well.. i didn't figure it out.. but did somethig different that does work.. not sure if it's better or worse.

I took out all the plumbing for the session module and instead created a session in the global.ascx file in the session_start... maybe that is where it should have been all along. from that point i was able to change teh spots where i was using the cookie to the session.

works as far as i can tell.. more testing will tell.

jvcoach23
  • 2,765
  • 10
  • 34
  • 50