浏览代码

adds migrate() to Session

This migrates the session to a new session id while not deleting the
actual session attributes.
Johannes Schmitt 14 年之前
父节点
当前提交
6432dea07c
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      src/Symfony/Component/HttpFoundation/Session.php

+ 9 - 0
src/Symfony/Component/HttpFoundation/Session.php

@@ -168,6 +168,15 @@ class Session implements \Serializable
         $this->storage->regenerate();
     }
 
+    /**
+     * Migrates the current session to a new session id while maintaining all
+     * session attributes.
+     */
+    public function migrate()
+    {
+        $this->storage->regenerate();
+    }
+
     /**
      * Returns the session ID
      *