diff --git a/lib/SimpleSAML/SessionHandlerCookie.php b/lib/SimpleSAML/SessionHandlerCookie.php
index a9995081b0cdf7752b50dff2b0c7068535895259..7eea4656d94cafb5b760fde23b29136054826d49 100644
--- a/lib/SimpleSAML/SessionHandlerCookie.php
+++ b/lib/SimpleSAML/SessionHandlerCookie.php
@@ -71,7 +71,7 @@ abstract class SessionHandlerCookie extends SessionHandler
     public function getCookieSessionId()
     {
         if ($this->session_id === null) {
-            if (self::hasSessionCookie()) {
+            if ($this->hasSessionCookie()) {
                 // attempt to retrieve the session id from the cookie
                 $this->session_id = $_COOKIE[$this->cookie_name];
             }