diff --git a/program/lib/Roundcube/rcube_session.php b/program/lib/Roundcube/rcube_session.php index f0c012cbf..9fc564fac 100644 --- a/program/lib/Roundcube/rcube_session.php +++ b/program/lib/Roundcube/rcube_session.php @@ -179,6 +179,24 @@ abstract class rcube_session $this->gc_shutdown(); } + /** + * Creates a new (separate) session + * + * @param array Session data + * + * @return string Session identifier (on success) + */ + public function create($data) + { + $length = strlen(session_id()); + $key = rcube_utils::random_bytes($length); + + // create new session + if ($this->write($key, $this->serialize($data))) { + return $key; + } + } + /** * Merge vars with old vars and apply unsets */