Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Https and cookies...

Status
Not open for further replies.

song2siren

Programmer
Jun 4, 2003
103
GB
Hello

I'm using cookies to track users around a shopping cart application, but I cannot seem to retrieve a cookie value on the secure part of my site.

I'm using the following code to either generate a new ID or retrieve an existing one:

Public Function GetShoppingCartId() As String

Dim _guidUserID As GUID
Dim objCookie As HttpCookie

objCookie = HttpContext.Current.Request.Cookies( "ConfUserID" )
If objCookie Is Nothing Then
_guidUserID = Guid.NewGuid
objCookie = New HttpCookie( "ConfUserID", _guidUserID.ToString )
objCookie.Expires = DateTime.Now.AddYears( 3 )
HttpContext.Current.Response.Cookies.Add( objCookie )
Return HttpContext.Current.Request.Cookies( "ConfUserID" ).Value
Else
Return objCookie.Value
End If

End Function

However, on any HTTPS pages an new ID and cookie is always generated. Any help suggestions would be very much appreciated.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top