diff --git a/lib/SimpleSAML/Kernel.php b/lib/SimpleSAML/Kernel.php
index 49b9d690648f9e25e00470643d5a24723ecfad14..f6d5de3b7f3af73ad0598766160d964614dab211 100644
--- a/lib/SimpleSAML/Kernel.php
+++ b/lib/SimpleSAML/Kernel.php
@@ -47,13 +47,13 @@ class Kernel extends BaseKernel
     public function getCacheDir(): string
     {
         $configuration = Configuration::getInstance();
-        $cachePath = $configuration->getString('tempdir') . '/cache/' . $this->module;
+        $cachePath = $configuration->getString('tempdir') . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . $this->module;
 
         if (0 === strpos($cachePath, '/')) {
             return $cachePath;
         }
 
-        return $configuration->getBaseDir() . '/' . $cachePath;
+        return $configuration->getBaseDir() . DIRECTORY_SEPARATOR . $cachePath;
     }
 
 
@@ -69,7 +69,7 @@ class Kernel extends BaseKernel
             return $loggingPath;
         }
 
-        return $configuration->getBaseDir() . '/' . $loggingPath;
+        return $configuration->getBaseDir() . DIRECTORY_SEPARATOR . $loggingPath;
     }