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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:04:10+00:00 2026-05-24T05:04:10+00:00

Perhaps I am over thinking this, but I would like to understand the purpose

  • 0

Perhaps I am over thinking this, but I would like to understand the purpose of redirecting a user after the POST of their credentials to login page. For example, the POST action can submit the user’s credentials, for example to something like /app/login.php, and then after authentication that login application page could load perhaps a landing page for the user without actually redirecting the user. However, is there something that happens if a user is redirected to a new page instead? It is recommended, but I have not found any explanation for it other than preventing the user from potentially reloading the page and potentially resubmitting form data. It is recommended as a security best practice and I can theorize why it might be done in that regard, but I would really like to have an answer other than “… because that is what everyone does.”

Thanks a lot in advance.

  • 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-24T05:04:11+00:00Added an answer on May 24, 2026 at 5:04 am

    Just as a very quick point. When the advice is to redirect a user, it is normally using the
    Post-Redirect-Get method. So the user isn’t usually presented with a ‘You are being redirected’ message or something similar. The server sends the redirect in the response and the browser takes action and goes to the location given.


    A short example:

    Imagine you have a site with:

    • A login page ( http://domain.com/login )
    • A dashboard page ( http://domain.com/dashboard ).

    One reason is for separation of functionality. So your login page is specifically for logging in and dashboard page is to show the user’s account (or something similar).

    Yup, you could just include the dashboard/other page in the login page without redirecting but then you run into another problem. If the user can access their dashboard using /login and /dashboard, what happens if they bookmark the login page? Also, if you are on a POSTed page, then if the user wants to refresh the page then the browser will probably warn them that they’ll repost. From a purely usability view, this would be really annoying if I had to keep accepting just to see my News Feed on Facebook.

    Each refresh on the posted page would log the user back in. If you had an audit log enabled then you’ll have a load of ‘Login’ records just because the user wanted to refresh the news feed. Imagine if your site did something on each user login (for example, sending an email out). Just refreshing the dashboard page would send out an email each time.


    Another reason is that lots of sites will provide a redirect URL when an unauthenticated user tries to access a restricted page. After logging in, the site redirects the user to the page they originally requested. The Post-Redirect-Get for logging in makes this easier to do (if you’ve already implemented it for general logging in, then it’s not much more effort to have this feature).

    There are various other reasons but one of the biggest for me is that the form isn’t resubmitted. Not related to just logging in, but I once had a ‘Test SMS’ feature on a site of mine that didn’t implement the Post-Redirect-Get method. Someone sent one test message and then kept pressing refresh. Within a few minutes all of my SMS credits were used up. Yes, the person could have just pressed back and resubmitted but refresh is just easier.

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

Sidebar

Related Questions

I'm perhaps being a bit lazy asking this here, but I'm just getting started
I have an iPhone app that I would like to port over to the
Perhaps I am not asking or searching for this correctly: I want to have
Perhaps not directly programming related, but definitely product / commercially related. And I can't
Perhaps this is a naive question. In my understanding, ASP.NET MVC cannot work with
Perhaps I'm missing something with the concept of Extension Methods, but I cannot gain
Perhaps my question is similar in nature to this one: Do you use design
Perhaps I am missing something, but I am just learning javascript. My understanding of
Or perhaps this is a manual install only deal.
Perhaps I'm missing something obvious here, but I'm having a hard time setting a

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.