summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
Diffstat (limited to 'framework')
-rw-r--r--framework/Web/THttpSession.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/framework/Web/THttpSession.php b/framework/Web/THttpSession.php
index bec4c126..adb91752 100644
--- a/framework/Web/THttpSession.php
+++ b/framework/Web/THttpSession.php
@@ -159,6 +159,21 @@ class THttpSession extends TApplicationComponent implements IteratorAggregate,Ar
$this->_started=false;
}
}
+
+ /**
+ * Update the current session id with a newly generated one
+ *
+ * @param boolean $deleteOld Whether to delete the old associated session or not.
+ * @return string old session id
+ * @link http://php.net/manual/en/function.session-regenerate-id.php
+ */
+ public function regenerate($deleteOld=false)
+ {
+ $old = $this->getID();
+ session_regenerate_id($deleteOld);
+ $this->setID(session_id());
+ return $old;
+ }
/**
* @return boolean whether the session has started