Explorar o código

adds migrate() to Session

This migrates the session to a new session id while not deleting the
actual session attributes.
Johannes Schmitt %!s(int64=14) %!d(string=hai) anos
pai
achega
6432dea07c
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  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
      *