Interface Yiisoft\User\Login\Cookie\CookieLoginIdentityInterface
| Extends | Yiisoft\Auth\IdentityInterface |
|---|
CookieLoginIdentityInterface should be implemented in order to automatically log user in based on a cookie.
See also:
Public Methods
| Method | Description | Defined By |
|---|---|---|
| getCookieLoginKey() | Returns a key that can be used to check the validity of a given identity ID. | Yiisoft\User\Login\Cookie\CookieLoginIdentityInterface |
| validateCookieLoginKey() | Validates the given key. | Yiisoft\User\Login\Cookie\CookieLoginIdentityInterface |
Method Details
Returns a key that can be used to check the validity of a given identity ID.
The key should be unique for each individual user, and should be persistent so that it can be used to check the validity of the user identity.
The space of such keys should be big enough to defeat potential identity attacks.
The returned key will be stored on the client side as part of a cookie and will be used to authenticate user even if PHP session has been expired.
Make sure to invalidate earlier issued keys when you implement force user logout, password change and other scenarios, that require forceful access revocation for old sessions.
See also validateCookieLoginKey().
| public abstract string getCookieLoginKey ( ) | ||
| return | string |
A key that is used to check the validity of a given identity ID. |
|---|---|---|
public function getCookieLoginKey(): string;
Validates the given key.
See also getCookieLoginKey().
| public abstract boolean validateCookieLoginKey ( string $key ) | ||
| $key | string |
The given key. |
| return | boolean |
Whether the given key is valid. |
|---|---|---|
public function validateCookieLoginKey(string $key): bool;
Signup or Login in order to comment.