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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:07:10+00:00 2026-06-15T05:07:10+00:00

I am having problems with my login process. I am using sessions and reloading

  • 0

I am having problems with my login process. I am using sessions and reloading so that I can have a single page site. On Chrome, this adds a ? so the end of the url (anytime the ? is present, login does not work). And on both Firefox and Chrome, the login-logout process only works once and then login stops working. I have an if statement on my index.php page that is essentially:

if($_SESSION["LoggedIn"] != true) {
    /*display login button*/
}
else {
    /*display logout button*/
}

Then I set my scripts file:

    $("#toolbarTitle-Login").click(function() {
        var loginEmail = $("#toolbarTextbox-Email").val();
        var loginPassword = $("#toolbarTextbox-Password").val();
        if (loginEmail != "") {
            $("#toolbarPleaseWait").text("Please wait...");
            $.post(
                'ajax/loginProcess.php', 
                {
                    'email': loginEmail,
                    'password': loginPassword
                },
                function (response) {
                    window.location.reload(true);
                }
            );
        }
    });

    $("#toolbarTitleLoggedIn-Logout").click(function() {
        $("#toolbarPleaseWait").text("Logging out...");
            $.post(
                'ajax/logoutProcess.php', 
                {
                },
                function (response) {
                    window.location.reload(true);
                }
            );
    });

Then my processing pages loginProcess.php:

<?php
session_start();

include "../incl/databaseConnection.php";

$email = $connection->real_escape_string($_POST["email"]);
$password = $connection->real_escape_string(md5($_POST["password"]));

$sql = "SELECT clientId
        FROM clients
        WHERE (studentEmail = '$email' AND studentPassword = '$password') OR (parentEmail = '$email' AND parentPassword = '$password');";

if (!$result = $connection->query($sql)) {
    die ('There was an error running the query [' . $connection->error . ']');
}

$rows = $result->num_rows;
$row = $result->fetch_assoc();

if ($rows == 1) {
$_SESSION["loggedIn"] = true;
$_SESSION["clientId"] = $row["clientId"];

}
else if ($rows > 1) {
echo 'CHOOSE BETWEEN ACCOUNTS';
}
else if ($rows == 0) {
echo 'SHOW ERROR MESSAGE';
}

$connection->close();

?>

Next logoutProcess.php:

<?php
session_start();
session_unset();

?>
  • 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-15T05:07:12+00:00Added an answer on June 15, 2026 at 5:07 am

    Okay, so it ended up being a very simple fix. I did not include return false; beneath my ajax post. This caused the page to reload as soon as I pushed the submit button (this action took place before the jquery fired), which is the natural behavior for <input type="submit">. The “?” was an indication of this submission, and showed that no POST variables had not been defined, or they would have been listed next to it.

        $("#toolbarTitle-Login").click(function() {
            var loginEmail = $("#toolbarTextbox-Email").val();
            var loginPassword = $("#toolbarTextbox-Password").val();
            if (loginEmail != "") {
                $("#toolbarPleaseWait").text("Please wait...");
                $.post(
                    'ajax/loginProcess.php', 
                    {
                        'email': loginEmail,
                        'password': loginPassword
                    },
                    function (response) {
                        window.location.reload(true);
                    }
                );
                return false;
            }
        });
    
    
        $("#toolbarTitleLoggedIn-Logout").click(function() {
            $("#toolbarPleaseWait").text("Logging out...");
    
            $.ajax({
                url: "ajax/logoutProcess.php",
                context: document.body
            }).done(function() { 
                window.location.reload(true);
            });
            return false;
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having problems with this page [see code below], and its cross browser
I have a Windows service, running using the login localhost\administrator . This service is
I am having problems with CakePHP2.0 login sessions and cookies. When i login from
I'm still new to code igniter and I'm having problems getting the login system
I am using devise and create login with Facebook using omniauth, but having problem
I'm having a problem with a simple html login page I made, where when
I'm having this weird problem with HtmlUnit in Java. I am using it to
Is anyone familiar with Cassia Terminal Service libraries? I’m having problems with the login
I have a webpage on my site that displays a table, reloads the XML
I am trying to create a login form. The problem that I am having

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.