summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/AppFramework/Http/Request.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php
index 8fb19f2d9b2..679ee5bc27c 100644
--- a/lib/private/AppFramework/Http/Request.php
+++ b/lib/private/AppFramework/Http/Request.php
@@ -486,6 +486,19 @@ class Request implements \ArrayAccess, \Countable, IRequest {
}
/**
+ * Whether the cookie checks are required
+ *
+ * @return bool
+ */
+ private function cookieCheckRequired() {
+ if($this->getCookie(session_name()) === null && $this->getCookie('oc_token') === null) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
* Checks if the strict cookie has been sent with the request if the request
* is including any cookies.
*
@@ -493,7 +506,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
* @since 9.1.0
*/
public function passesStrictCookieCheck() {
- if(count($this->cookies) === 0) {
+ if(!$this->cookieCheckRequired()) {
return true;
}
if($this->getCookie('nc_sameSiteCookiestrict') === 'true'
@@ -511,7 +524,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
* @since 9.1.0
*/
public function passesLaxCookieCheck() {
- if(count($this->cookies) === 0) {
+ if(!$this->cookieCheckRequired()) {
return true;
}
if($this->getCookie('nc_sameSiteCookielax') === 'true') {