aboutsummaryrefslogtreecommitdiffstats
path: root/include/session.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-03-13 21:19:33 +0100
committerMario Vavti <mario@mariovavti.com>2016-03-13 21:19:33 +0100
commita8d5c832515581ef1f2c128e43c03b77d3151014 (patch)
treed086123b9fa1539f9bdb305285aeb897a2c2eb60 /include/session.php
parent370a007ee215d2889d9bf760b0247678c08d31ac (diff)
parent7747a23a7895bfa2aac0b95604ea42dab6630079 (diff)
downloadvolse-hubzilla-a8d5c832515581ef1f2c128e43c03b77d3151014.tar.gz
volse-hubzilla-a8d5c832515581ef1f2c128e43c03b77d3151014.tar.bz2
volse-hubzilla-a8d5c832515581ef1f2c128e43c03b77d3151014.zip
Merge branch 'master' of https://github.com/redmatrix/hubzilla
Diffstat (limited to 'include/session.php')
-rw-r--r--include/session.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/session.php b/include/session.php
index 43bba528b..6060e4712 100644
--- a/include/session.php
+++ b/include/session.php
@@ -12,6 +12,38 @@
$session_exists = 0;
$session_expire = 180000;
+
+/**
+ * @brief Resets the current session.
+ *
+ * @return void
+ */
+
+function nuke_session() {
+ new_cookie(0); // 0 means delete on browser exit
+
+ unset($_SESSION['authenticated']);
+ unset($_SESSION['account_id']);
+ unset($_SESSION['uid']);
+ unset($_SESSION['visitor_id']);
+ unset($_SESSION['administrator']);
+ unset($_SESSION['cid']);
+ unset($_SESSION['theme']);
+ unset($_SESSION['mobile_theme']);
+ unset($_SESSION['show_mobile']);
+ unset($_SESSION['page_flags']);
+ unset($_SESSION['delegate']);
+ unset($_SESSION['delegate_channel']);
+ unset($_SESSION['my_url']);
+ unset($_SESSION['my_address']);
+ unset($_SESSION['addr']);
+ unset($_SESSION['return_url']);
+ unset($_SESSION['remote_service_class']);
+ unset($_SESSION['remote_hub']);
+}
+
+
+
function new_cookie($time) {
$old_sid = session_id();