1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-11 17:24:46 +02:00

Add $session->hasLoginCookie() method

This commit is contained in:
Ryan Cramer
2021-03-30 08:08:07 -04:00
parent 16fd4d4ab7
commit 7f450dedc7
2 changed files with 15 additions and 1 deletions

View File

@@ -156,7 +156,7 @@ class PaginatedArray extends WireArray implements WirePaginatable {
*
* #pw-group-other
*
* @return int
* @return bool
* @since 3.0.120
*
*/

View File

@@ -235,6 +235,20 @@ class Session extends Wire implements \IteratorAggregate {
return !empty($_COOKIE[$name]);
}
/**
* Is a session login cookie present?
*
* This only indicates the user was likely logged in at some point, and may not indicate an active login.
* This method is more self describing version of `$session->hasCookie(true);`
*
* @return bool
* @since 3.0.175
*
*/
public function hasLoginCookie() {
return $this->hasCookie(true);
}
/**
* Start the session
*