From 36880b87c990cc506e09adb3a5f71dadd9e2a082 Mon Sep 17 00:00:00 2001 From: Marco Date: Wed, 18 Oct 2017 23:03:41 +0200 Subject: [PATCH] Implement method 'createRememberCookieName' in class 'Auth' --- src/Auth.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Auth.php b/src/Auth.php index 0139b09..b6515b9 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -1803,4 +1803,17 @@ final class Auth extends UserManager { return $descriptor . '_' . $token; } + /** + * Generates a unique cookie name for the 'remember me' feature + * + * @param string|null $sessionName (optional) the session name that the output should be based on + * @return string + */ + public static function createRememberCookieName($sessionName = null) { + return self::createCookieName( + 'remember', + ($sessionName !== null) ? $sessionName : \session_name() + ); + } + }