2
- Asp.Net MVC 3
- FormsAuthentication(自定义)
- iPad的MobileSafari
- IFRAME(同一域)
与formsTicket.UserData
没有经过挣扎与MobileSafari(仅MoblieSafari)工作,我发现,这是httpContext.User.Identity.Ticket.UserData
空(在MobileSa fari,而不是其他人)与原FormsAuthentication 的HttpCookie包含正确的价值观?!?FormsAuthentication:失去的UserData(但在饼干)
这怎么可能?
代码:
public void UpdateContext()
{
if (httpContext.User.Identity is FormsIdentity)
{
// Get Forms Identity From Current User
FormsIdentity id = (FormsIdentity)httpContext.User.Identity;
// Create a custom Principal Instance and assign to Current User (with caching)
HttpCookie cookie = HttpContext.Current.Request.Cookies.Get(FormsAuthentication.FormsCookieName);
FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(cookie.Value);
var cookieUserData = ticket.UserData; // not empty
var httpContextIdentiyUserData = id.Ticket.UserData; // empty!
...
}
}
任何线索将是有益的!
了Lg
Warappa
PS:如果它的事项,我用我的网站的页面中的iframe - 同一个域。
找到这个 http://stackoverflow.com/questions/4158550/problem-with-asp-net-forms-authentication-when-using-iphone-uiwebview – 2012-01-09 09:22:57