Hi, I'm have a little trouble with my cookies
I'm using cookies to hold session data. Mainly because I don't want the session to time out - If there is a way of using session vars without the session timing out then I'd love to hear about it.
Anyway my cookie may or may not have been set depending on where the user has been on the site. when I try to set the value I'm getting an error Object reference not set. I'm positive it's the cookie because I can see the MS_No in the querystring and the spelling etc. is all okay.
VB Code:
If Not Page.IsPostBack Then ' Get the cookies Dim MS_No As HttpCookie = Request.Cookies.Item("MS_No") ' Check the query string for the ms # If Not IsNothing(Request.QueryString("ms_no")) Then If Request.QueryString("ms_no").ToString <> String.Empty Then [HL="#FFFF00"]MS_No.Value = Request.QueryString("ms_no").ToString ' Set the instance value[/HL] Response.Cookies("MS_No").Value = MS_No.Value ' Set the base value End If End If End If
All help will be greatly appreciated
Cheers Al




Reply With Quote