Re: Can't Write Cookie IE

Tech-Archive recommends: Fix windows errors by optimizing your registry



Sorry I forgot to mention that. Yes we have worked and worked with the
clients including setting their privacy settings to nothing and this stil
doesn't seem to have any effect.

"Curt_C [MVP]" wrote:

> Are you sure the clients have their browser set to allow cookies?
> Some dont.
>
>
> --
> Curt Christianson
> site: http://www.darkfalz.com
> blog: http://blog.darkfalz.com
>
>
> GarrettD78 wrote:
> > I am having trouble with my authentication cookie with IE. I create and write
> > the cookie here but some of the client PC never get the cookie. This does
> > work with other browsers like Firefox.
> >
> > If Request.Cookies("portalroles") Is Nothing Then
> >
> > Dim _user As New UsersDB
> > Dim roleStr As String = ""
> > Dim role As String
> >
> > roleStr = _user.GetRoles(User.Identity.Name)
> >
> >
> > 'For Each role In roles
> >
> > 'roleStr += role
> > 'roleStr += ";"
> >
> > 'Next
> >
> > Dim ticket As New FormsAuthenticationTicket(1, _
> > Context.User.Identity.Name, _
> > DateTime.Now, _
> > DateTime.Now.AddHours(1), _
> > False, _
> > roleStr)
> >
> > Dim cookieStr As String = FormsAuthentication.Encrypt(ticket)
> >
> >
> > 'Send Cookie to client
> > Response.Cookies("portalroles").Value = cookieStr
> > Response.Cookies("portalroles").Path = "/"
> > Response.Cookies("portalroles").Expires =
> > DateTime.Now.AddMinutes(5)
> >
> > Worst part is this works on most of my clients but not on other.s
> > Thanks
>
.


Quantcast