diff --git a/lib/SimpleSAML/AuthMemCookie.php b/lib/SimpleSAML/AuthMemCookie.php
index 17d9071a5ba7f89a26723da5b0e3031c52a27bfe..958952041854c93cb5f33e343d05ab3c778bba3d 100644
--- a/lib/SimpleSAML/AuthMemCookie.php
+++ b/lib/SimpleSAML/AuthMemCookie.php
@@ -1,5 +1,6 @@
 <?php
 
+namespace SimpleSAML;
 
 /**
  * This is a helper class for the Auth MemCookie module.
@@ -10,17 +11,17 @@
  *
  * @deprecated This class has been deprecated and will be removed in SSP 2.0. Use the memcookie module instead.
  */
-class SimpleSAML_AuthMemCookie
-{
 
+class AuthMemCookie
+{
     /**
-     * @var SimpleSAML_AuthMemCookie This is the singleton instance of this class.
+     * @var AuthMemCookie This is the singleton instance of this class.
      */
     private static $instance = null;
 
 
     /**
-     * @var \SimpleSAML\Configuration The configuration for Auth MemCookie.
+     * @var Configuration The configuration for Auth MemCookie.
      */
     private $amcConfig;
 
@@ -28,12 +29,12 @@ class SimpleSAML_AuthMemCookie
     /**
      * This function is used to retrieve the singleton instance of this class.
      *
-     * @return SimpleSAML_AuthMemCookie The singleton instance of this class.
+     * @return AuthMemCookie The singleton instance of this class.
      */
     public static function getInstance()
     {
         if (self::$instance === null) {
-            self::$instance = new SimpleSAML_AuthMemCookie();
+            self::$instance = new AuthMemCookie();
         }
 
         return self::$instance;
@@ -46,7 +47,7 @@ class SimpleSAML_AuthMemCookie
     private function __construct()
     {
         // load AuthMemCookie configuration
-        $this->amcConfig = \SimpleSAML\Configuration::getConfig('authmemcookie.php');
+        $this->amcConfig = Configuration::getConfig('authmemcookie.php');
     }
 
 
@@ -71,7 +72,7 @@ class SimpleSAML_AuthMemCookie
     {
         $cookieName = $this->amcConfig->getString('cookiename', 'AuthMemCookie');
         if (!is_string($cookieName) || strlen($cookieName) === 0) {
-            throw new Exception(
+            throw new \Exception(
                 "Configuration option 'cookiename' contains an invalid value. This option should be a string."
             );
         }
@@ -119,7 +120,7 @@ class SimpleSAML_AuthMemCookie
 
         $class = class_exists('Memcache') ? 'Memcache' : (class_exists('Memcached') ? 'Memcached' : false);
         if (!$class) {
-            throw new Exception('Missing Memcached implementation. You must install either the Memcache or Memcached extension.');
+            throw new \Exception('Missing Memcached implementation. You must install either the Memcache or Memcached extension.');
         }
 
         // Create the Memcache(d) object.
diff --git a/www/authmemcookie.php b/www/authmemcookie.php
index 672b83762f48c482363e98af13324d3bedd60d02..032c05f4c568d10c8c6fe50b20f249bf2ac01a99 100644
--- a/www/authmemcookie.php
+++ b/www/authmemcookie.php
@@ -24,7 +24,7 @@ try {
     }
 
     // load Auth MemCookie configuration
-    $amc = SimpleSAML_AuthMemCookie::getInstance();
+    $amc = \SimpleSAML\AuthMemCookie::getInstance();
 
     $sourceId = $amc->getAuthSource();
     $s = new \SimpleSAML\Auth\Simple($sourceId);
@@ -33,7 +33,7 @@ try {
     $s->requireAuth();
 
     // generate session id and save it in a cookie
-    $sessionID = SimpleSAML\Utils\Random::generateID();
+    $sessionID = \SimpleSAML\Utils\Random::generateID();
     $cookieName = $amc->getCookieName();
     \SimpleSAML\Utils\HTTP::setCookie($cookieName, $sessionID);
 
@@ -45,7 +45,7 @@ try {
     // username
     $usernameAttr = $amc->getUsernameAttr();
     if (!array_key_exists($usernameAttr, $attributes)) {
-        throw new Exception(
+        throw new \Exception(
             "The user doesn't have an attribute named '".$usernameAttr.
             "'. This attribute is expected to contain the username."
         );
@@ -56,7 +56,7 @@ try {
     $groupsAttr = $amc->getGroupsAttr();
     if ($groupsAttr !== null) {
         if (!array_key_exists($groupsAttr, $attributes)) {
-            throw new Exception(
+            throw new \Exception(
                 "The user doesn't have an attribute named '".$groupsAttr.
                 "'. This attribute is expected to contain the groups the user is a member of."
             );
@@ -97,10 +97,10 @@ try {
 
     // register logout handler
     $session = \SimpleSAML\Session::getSessionFromRequest();
-    $session->registerLogoutHandler($sourceId, 'SimpleSAML_AuthMemCookie', 'logoutHandler');
+    $session->registerLogoutHandler($sourceId, '\SimpleSAML\AuthMemCookie', 'logoutHandler');
 
     // redirect the user back to this page to signal that the login is completed
     \SimpleSAML\Utils\HTTP::redirectTrustedURL(\SimpleSAML\Utils\HTTP::getSelfURL());
-} catch (Exception $e) {
+} catch (\Exception $e) {
     throw new \SimpleSAML\Error\Error('CONFIG', $e);
 }