summaryrefslogtreecommitdiff
path: root/login.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-10-15 15:59:16 +0300
committerAndrew Dolgov <[email protected]>2018-10-15 15:59:16 +0300
commit2a029c40505796c19a7fd4f86e140da2e5c548a4 (patch)
treeb0e987e3de7cd561917a4d42be7fe31e6a8abc26 /login.php
parentb5b914878733d9c1a7f95f833dcda15cad9770d9 (diff)
add some session handling-related improvements
Diffstat (limited to 'login.php')
-rw-r--r--login.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/login.php b/login.php
index 8a142d0..ba066aa 100644
--- a/login.php
+++ b/login.php
@@ -19,6 +19,14 @@
if ($line = $sth->fetch()) {
require_once "sessions.php";
+ if (session_status() != PHP_SESSION_NONE) {
+ session_destroy();
+ session_commit();
+ }
+
+ session_start();
+ session_regenerate_id(true);
+
$_SESSION["owner"] = $user;
header("Location: index.php");
} else {