Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5953263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:48:00+00:00 2026-05-22T17:48:00+00:00

Asp.Net MVC 3 FormsAuthentication (custom) iPad MobileSafari iframe (same domain) After struggling with formsTicket.UserData

  • 0
  • Asp.Net MVC 3
  • FormsAuthentication (custom)
  • iPad MobileSafari
  • iframe (same domain)

After struggling with formsTicket.UserData not working with MobileSafari (ONLY MoblieSafari), I found out, that httpContext.User.Identity.Ticket.UserData is empty (in MobileSafari, not the others) and the original FormsAuthentication HttpCookie contains the right values?!?

How can that be?!

Code:

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!
        ...
    }
}

Any clue would be helpful!

Lg
Warappa

PS: If it matters, I use a page of my website in an iframe – same domain.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:48:01+00:00Added an answer on May 22, 2026 at 5:48 pm

    So the issue was the following:
    This error arose when I logged out and accessed a page that did a history.back().

    Looking at the traffic with Fiddler I saw, that Asp.Net used the cookieless authentication mode, so the authentication was encoded into the url. Now, when the history.back() occurred, the url pointed to the Logout url with the now invalid authentication information… nasty bug at my side.

    Forcing Asp.Net to use cookies did the trick!

    Lg
    warappa

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on an ASP.Net Mvc 3 application using FormsAuthentication with a custom
I am trying to create a custom authentication scheme in ASP.NET MVC using form
In an ASP.NET MVC application when using a custom Dependency Injection container (in this
I am developing an asp.net mvc application and have created my custom user database
I'm using forms authentication in my current asp.net web forms application not MVC and
I have a asp.net mvc application and am trying to get custom errors working
I want to use forms authentication in my asp.net mvc site. Can I use
I'm writing an app using asp.net-mvc deploying to iis6. I'm using forms authentication. Usually
ASP.NET MVC has been discussed on this forum a few times. I'm about to
ASP.NET MVC routes have names when mapped: routes.MapRoute( Debug, // Route name -- how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.