0

I have a login form that stopped working right after enabling SSL, and I have no clue why.

Part of my code below:

Verification if correct login

if($is_active == '1') {
                if($username == $user && $password_signin == $password) {
                   header("Location: https://website.tk/index.php");
                   $_SESSION['id'] = $id;
                   $_SESSION['level'] = $level;
                   $_SESSION['user'] = $user;
                   

                } else {

Login form:

<form class="user" action="" method="post">
                  <div class="form-group">
                    <input type="text" class="form-control form-control-user" id="user_signin" name="user_signin" placeholder="Utilizador...">
                  </div>
                  <div class="form-group">
                    <input type="password" class="form-control form-control-user" id="password_signin" name="password_signin" placeholder="Password...">
                  </div>
                  <button type="submit" name="login" id="sign_in" class="btn btn-primary btn-user btn-block">Login
                  </button>
                  <hr>
                </form>

I was working before enabling SSL on the website when I log in it does not show any error just looks like it is not setting the SESSION variables

  • Did you check your cookie settings? Or debug your cookies to see if the session id is being sent? `var_dump($_COOKIE)` – bassxzero Dec 22 '20 at 03:50
  • It didn't solve also have this notice now because added session start to index and login.php Notice: session_start(): A session had already been started - ignoring in /var/www/supernodelog/controllers/login.php on line 2 – Kacelyn Nardos Dec 22 '20 at 09:08
  • Please share more details, and your debugging attempts – Nico Haase Dec 22 '20 at 09:44

1 Answers1

0

If the login page is using 'http', try to use 'https' instead.

Session works in the same protocol.

Li Yong
  • 16
  • 5