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 8102741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:19:19+00:00 2026-06-05T23:19:19+00:00

Quick question (and sorry if it’s already been asked, I have looked but couldn’t

  • 0

Quick question (and sorry if it’s already been asked, I have looked but couldn’t find it).

I have a webforms app which has a page that contains an iframe and serves up an MVC page.

I need to do the login authentication within the web app and to check in the MVC app that we are authenticated (I’m sure there are better ways, but sadly this is how it already is, it’s not my job to change it).

I know of various fudges to make this work, but is there a nice/correct way to achieve this?

thanks in advance

Daz

  • 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-06-05T23:19:20+00:00Added an answer on June 5, 2026 at 11:19 pm

    Assuming that the WebForms and MVC apps are in separate solutions, but deployed to the same server,

    1. Make sure that your authentication mechanism is using FormsAuthentication.

    2. Place both the WebForms and MVC app on the same domain, i.e. example.com

    3. Edit the Web.config of both the apps and set <system.web><machineKey> to the same value. You can generate machine key via http://www.insitesystems.com/services/machine-key-generator.html

      — OR —

      leave out the machineKey of both the web.config to inherit from the parent web.config or machine.config on the server. (never tested this)

    4. Use the same <membership> and <authentication> settings. Having same membership settings allows you to sign in from both the apps, since users’ passwords are store in the same database. Having same authentication settings ensures that the same authentication cookies get submitted no matter whether it is sent to WebForms or MVC

    5. Add the following to your MVC controllers to output P3P header to force IE to accept cookies inside the IFRAME. Please customize the value, as your privacy policy is very likely different from mine. See http://www.p3pwriter.com/LRN_111.asp for details. (Alternatively, put it inside a base Controller class and inherit it from all your controllers.)

      protected override void OnActionExecuted(ActionExecutedContext filterContext)
      {
          filterContext.HttpContext.Response.AddHeader("P3P", @"CP=""CAO PSD OUR CUR""");
          base.OnActionExecuted(filterContext);
      }
      

    Edit

    On 2nd thought, step 5 is not needed, since both the main document and iframe comes from the same domain. The cookies thus should be considered first party, rather than 3rd party (which gets blocked by IE).

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

Sidebar

Related Questions

I have a quick question about ARC in iOS. (Sorry I've asked so many
Okay I'm really sorry if this question has been asked, but I can't seem
Quick question. I have an app that use a native DLL through PInvoke, this
I'm sorry for this newbie question, but I need a quick answer to tell
This may have been answered before, but I cannot find a solution that works.
Quick question... I have a query that checks for duplicates that looks like this:
Quick question, What have I done wrong here. The purpose of this code is
Quick question. I'm in a bit of a rush but if someone could quickly
A quick question of perhaps a more speculative nature. I've been getting heavy into
I had a quick question regarding RegEx... I have a string that looks something

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.