www.webdeveloper.com
Results 1 to 3 of 3

Thread: After login, back button click directs me to homepage, not back at the login form

Hybrid View

  1. #1
    Join Date
    Nov 2012
    Posts
    5

    Lightbulb After login, back button click directs me to homepage, not back at the login form

    Hello,

    I've noticed on many websites this very useful characteristic:
    Say you log in, or sign up. After clicking the submit form button, you're directed to a page in the website (that's inaccessible to non-members). But when you click the back button, instead of going back to the forms, you're redirected to the homepage.
    Could anyone please explain how I can achieve this?

    Thank you for your time.

  2. #2
    Join Date
    Feb 2012
    Location
    Tallahassee, FL
    Posts
    280
    On the login page, have a check to see if they are already logged in, for example, I use a session variable, we will call it key. I have a authentication call that runs a few check on 'key' and returns true or false depending on the validation status. My login page would look something like:
    PHP Code:
    if(isset($_SESSION['key']) && isValid($_SESSION['key'])){
        
    header("Location: someOtherPage.php");
    }else{
        
    //Login form


  3. #3
    Join Date
    Nov 2012
    Posts
    5
    Your help is greatly appreciated, thank you.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles