summaryrefslogtreecommitdiff
path: root/sessions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-03-05 21:14:35 +0300
committerAndrew Dolgov <[email protected]>2021-03-05 21:14:35 +0300
commit2b8b845abe7c13ecbb266613910484310cffe8e1 (patch)
tree90bd2e93737c2aad17cfb09496cc57cf3f9968cd /sessions.php
parentb2341679d53b227fc90fba34c3a7e6453e3cad6e (diff)
* use ORM for trivial queries
* environment-based configuration * useradm.php -> update.php with new options * support for schema migrations * various fixes
Diffstat (limited to 'sessions.php')
-rw-r--r--sessions.php35
1 files changed, 0 insertions, 35 deletions
diff --git a/sessions.php b/sessions.php
deleted file mode 100644
index 7755140..0000000
--- a/sessions.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
- require_once "config.php";
- require_once "db.php";
-
- define('SESSION_LIFETIME', 365 * 86400);
-
- ini_set("session.name", "epube_sid");
- ini_set("session.use_only_cookies", true);
- ini_set("session.gc_maxlifetime", SESSION_LIFETIME);
- ini_set("session.cookie_lifetime", SESSION_LIFETIME);
-
- function logout_user() {
- session_destroy();
-
- if (isset($_COOKIE[session_name()])) {
- setcookie(session_name(), '', time()-42000, '/');
- }
-
- session_commit();
- }
-
- if (@$_SERVER['HTTPS'] == "on") {
- ini_set("session.cookie_secure", true);
- }
-
- session_set_cookie_params(SESSION_LIFETIME);
-
- session_save_path(__DIR__ . "/sessions");
-
- register_shutdown_function('session_write_close');
-
- if (isset($_COOKIE[session_name()])) {
- session_start();
- }
-?>