Browse Source

fix session init

main
ghost 3 years ago
parent
commit
8ea31e92cb
  1. 9
      src/application/controller/login.php

9
src/application/controller/login.php

@ -65,13 +65,16 @@ if (isset($_POST) && $_POST) { @@ -65,13 +65,16 @@ if (isset($_POST) && $_POST) {
if ($_twister->importWallet($userName, $userPrivateKey)) {
// @TODO
// @TODO: add login time
// Auth
if (!session_id()) {
if (session_id()) {
session_destroy();
}
session_start();
$_SESSION['username'] = $userName;
}
// Redirect
header('Location: ' . PROJECT_HOST, true, 302);

Loading…
Cancel
Save