- Asp.Net MVC 3
- FormsAuthentication (カスタム)
- iPad モバイルSafari
- iframe (同一ドメイン)
MobileSafariformsTicket.UserData
(MoblieSafariのみ)で動作しないことに苦労した後、それが空であり(MobileSafariでは他のものではなく)、元のFormsAuthentication HttpCookieに正しい値が含まれていることがわかりました?!?httpContext.User.Identity.Ticket.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!
...
}
}
どんな手がかりも役に立ちます!
ラグワラッパー
_
PS: 問題があれば、同じドメインの iframe で自分の Web サイトのページを使用しています。