summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
authorgodzilla80@gmx.net <>2011-02-26 13:53:39 +0000
committergodzilla80@gmx.net <>2011-02-26 13:53:39 +0000
commit09e47185124cc4674fac4656959d57c92537d355 (patch)
tree5883957e850efc37443f4a68bea40f2d765f06cd /framework/Web
parentd016d6c7f9d4f0ca44e004c2cfad5d98be1e86c7 (diff)
Add THttpSession::regenerate() to update the current session id with a newly generated one
Diffstat (limited to 'framework/Web')
-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