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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:13:06+00:00 2026-05-18T05:13:06+00:00

Here are my pages: Redirect Page: if user has an open session, redirect to

  • 0

Here are my pages:

Redirect Page:
if user has an open session, redirect to the proper resource
else redirect to login page

Login Page:
if user login info is valid, redirect to $_SERVER[‘HTTP_REFERER’]
else display login page

When you visit the redirect page, it sees that you do not have a valid session and redirects to the login page. You can then login no problems, but after authentication I receive the “This webpage has a redirect loop.” page in Chrome.

It’s not a true loop, since there are several ways out (IE provide valid login details and go to destination resource, provide invalid login and receive error message, etc). But I can see the browser’s confusion (going from a to b to a again).

Any ideas how I can solve this problem?

Cheers

  • 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-18T05:13:06+00:00Added an answer on May 18, 2026 at 5:13 am

    $_SERVER[‘HTTP_REFERER’] will always be the login page since you have to load the login page right before you successfully login. So once you successfully login, the referrer is the login page, so the login page redirects you to the login page, which you still successfully logged in, so it logs you in over and over.

    Rather than relying on $_SERVER[‘HTTP_REFERER’] you should probably store the page they are trying to get to in either a $_SESSION or $_COOKIE variable. Most likely session will be better, depending upon your setup.

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

Sidebar

Related Questions

I am writing a password-reset page for my website. Here's my idea: a. User
Here is the scenario: I have two asp pages. a.aspx is layout and b.aspx
I've done scaffolding using the method described here http://wiki.rubyonrails.org/rails/pages/ScaffoldGenerator However, I want to know
Here's the problem: 1.) We have page here... www.blah.com/mypage.html 2.) That page requests a
Here's the page: https://www.testmasters.net/test/ssltest2.aspx When I go to it (in firefox or chrome), it
Here's my scenario: I have a page containing several links; each link is meant
here's what I'm trying to do : On a page, I would have a
Here's what I have: Quarter Sheet Flyer (4 per page) as a PSD or
Here's the scenario: I have a textbox and a button on a web page.
My master page contains a list as shown here. What I'd like to do

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.