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

  • SEARCH
  • Home
  • 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 356193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:05:19+00:00 2026-05-12T12:05:19+00:00

We have an email confirmation page for registration which can be hit with a

  • 0

We have an email confirmation page for registration which can be hit with a use-once link to activate the account.

The nature of the site is such that we can allow this link to log the user in automatically. This requirement is under review (at my request!).

The following situation is proving a little confusing:

  1. The user follows the confirmation link in their email
  2. This lands on the Confirm controller.
  3. All things being good, the user is automatically logged in, using:

    FormsAuth.SignIn(user.UserName,false);
    
  4. The View is returned from the controller

The View uses a master page which contains a partial view that is the LogonUserControl.ascx component.
Within the component, there is the following code (it comes straight out of the asp.net mvc project template):

if (Request.IsAuthenticated) { /*foo*/ }

When the page is rendered, Request.IsAuthenticated is returning false despite signing the user in at the controller.

I’m wondering why this might be. Has the master already been written out by the time the FormsAuth.SignIn method is called, or is using the Request object for this check wrong, because at the time the Request was received, it was indeed non-authenticated?

EDIT: It appears the default LogOn controller uses a redirect rather than returning a View. This would of course solve the problem, however I am interested in why the scenario above does not work.

  • 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-12T12:05:19+00:00Added an answer on May 12, 2026 at 12:05 pm

    It doesn’t work because the Request, which has already happened before your action runs, wasn’t authenticated. A Request is either authenticated, or it isn’t; it cannot start life as a non-authenticated and become authenticated in the middle of an action. An Authenticated request is one which was submitted with a valid authentication ticket. Since the login request did not include that, it isn’t authenticated and cannot become authenticated.

    However, when you redirect, the browser issues a new request, which does, of course, come with a valid authentication ticket, usually in the form of a cookie.

    Incidentally, redirecting is the right thing to do in this case. Your login is a POST, and you should use the Post/Redirect/Get pattern. Imagine that the login page returns the user to the site home page. If you return the view instead of redirecting to the home page, then when the user pressed F5 to refresh the page, the browser would warn them that they were about to resubmit their login credentials, which isn’t what you want. Doing a redirect makes the browser do a GET for the homepage, so the user will not be warned if they press F5.

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

Sidebar

Related Questions

I have a RegisterModel view model I use for my new account registration page.
I have a login.jsp page which contains a login form. Once logged in the
I have an 'account' view, where a user can change his email, name, and
I'm programming in PHP and would like to create web pages which have email
I have two collections which have property Email in both collections. I need to
I have a list of email address which I want to distribute evenly by
I have a Registaration page with the following fields Email, Confirm Email, Password and
In order to have a post-registration page, I added a RegistrationsController and method to
I have email addresses encoded with HTML character entities. Is there anything in .NET
Most of my users have email addresses associated with their profile in /etc/passwd .

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.