nafasak
یک شنبه 03 مهر 1390, 13:56 عصر
سلام من برای لاگین از کد زیر استفاده میکنم:
Dim ticket As New FormsAuthenticationTicket(1, UserName.ToLower, DateTime.Now, DateTime.Now.AddMinutes(30), True, UserRols, _
FormsAuthentication.FormsCookiePath)
' Path cookie valid for
' Encrypt the cookie using the machine key for secure transport
Dim hash As String = FormsAuthentication.Encrypt(ticket)
' Name of auth cookie
Dim cookie As New HttpCookie(FormsAuthentication.FormsCookieName, hash)
' Hashed ticket
' Set the cookie's expiration time to the tickets expiration time
If ticket.IsPersistent Then
cookie.Expires = ticket.Expiration
End If
' Add the cookie to the list for outgoing response
System.Web.HttpContext.Current.Response.Cookies.Ad d(cookie)
ولی مشکلی که هست اینه که برخی کلاینت ها با لاگین مشکل پیدا میکنند، مثلا ممکنه با IE نتونن لاگین کنن یا برخی با Firefox نمیتونن لاگین کنن، اکثرا با IE
؟؟؟
کسی نظری داره؟
Dim ticket As New FormsAuthenticationTicket(1, UserName.ToLower, DateTime.Now, DateTime.Now.AddMinutes(30), True, UserRols, _
FormsAuthentication.FormsCookiePath)
' Path cookie valid for
' Encrypt the cookie using the machine key for secure transport
Dim hash As String = FormsAuthentication.Encrypt(ticket)
' Name of auth cookie
Dim cookie As New HttpCookie(FormsAuthentication.FormsCookieName, hash)
' Hashed ticket
' Set the cookie's expiration time to the tickets expiration time
If ticket.IsPersistent Then
cookie.Expires = ticket.Expiration
End If
' Add the cookie to the list for outgoing response
System.Web.HttpContext.Current.Response.Cookies.Ad d(cookie)
ولی مشکلی که هست اینه که برخی کلاینت ها با لاگین مشکل پیدا میکنند، مثلا ممکنه با IE نتونن لاگین کنن یا برخی با Firefox نمیتونن لاگین کنن، اکثرا با IE
؟؟؟
کسی نظری داره؟