PHPackages                             simplesamlphp/simplesamlphp-module-memcookie - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. simplesamlphp/simplesamlphp-module-memcookie

ActiveSimplesamlphp-module[Authentication &amp; Authorization](/categories/authentication)

simplesamlphp/simplesamlphp-module-memcookie
============================================

A SimpleSAMLphp module that allows integration with Auth MemCookie, allowing web applications written in other languages than PHP to integrate with SimpleSAMLphp.

v1.3.3(1y ago)56.3M—0.4%3[1 issues](https://github.com/simplesamlphp/simplesamlphp-module-memcookie/issues)[1 PRs](https://github.com/simplesamlphp/simplesamlphp-module-memcookie/pulls)1LGPL-2.1PHPPHP ^8.1CI passing

Since Feb 18Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/simplesamlphp/simplesamlphp-module-memcookie)[ Packagist](https://packagist.org/packages/simplesamlphp/simplesamlphp-module-memcookie)[ Docs](https://simplesamlphp.org/)[ RSS](/packages/simplesamlphp-simplesamlphp-module-memcookie/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (12)Used By (1)

SimpleSAMLphp AuthMemCookie module
==================================

[](#simplesamlphp-authmemcookie-module)

[![Build Status](https://github.com/simplesamlphp/simplesamlphp-module-memcookie/actions/workflows/php.yml/badge.svg)](https://github.com/simplesamlphp/simplesamlphp-module-memcookie/actions/workflows/php.yml/badge.svg)[![Coverage Status](https://camo.githubusercontent.com/ff5a00d76bbbae65a296098383a20c46c564a5dbf4fe976091632c5eec21ef01/68747470733a2f2f636f6465636f762e696f2f67682f73696d706c6573616d6c7068702f73696d706c6573616d6c7068702d6d6f64756c652d6d656d636f6f6b69652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/simplesamlphp/simplesamlphp-module-memcookie)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/d0fe18dbf9e8743f763b2c0d0258e30f27e1d42517a30cd2c71121953c751ced/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73696d706c6573616d6c7068702f73696d706c6573616d6c7068702d6d6f64756c652d6d656d636f6f6b69652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/simplesamlphp/simplesamlphp-module-memcookie/?branch=master)[![Type Coverage](https://camo.githubusercontent.com/c596d00fda4c9ae9d696cbe7362121d9744c46dd8088455dab0b92cf2c5c10df/68747470733a2f2f73686570686572642e6465762f6769746875622f73696d706c6573616d6c7068702f73696d706c6573616d6c7068702d6d6f64756c652d6d656d636f6f6b69652f636f7665726167652e737667)](https://shepherd.dev/github/simplesamlphp/simplesamlphp-module-memcookie)[![Psalm Level](https://camo.githubusercontent.com/22b9eeaa1722d62a303333cc96dcb2261ee3932eb3afab14e37bd5c5e8920fd6/68747470733a2f2f73686570686572642e6465762f6769746875622f73696d706c6573616d6c7068702f73696d706c6573616d6c7068702d6d6f64756c652d6d656d636f6f6b69652f6c6576656c2e737667)](https://shepherd.dev/github/simplesamlphp/simplesamlphp-module-memcookie)

This module implements [Auth MemCookie](https://zenprojects.github.io/Apache-Authmemcookie-Module/) support for SimpleSAMLphp. This allows you to integrate SimpleSAMLphp with web applications written in languages other than PHP.

*AuthMemCookie* works by reading authentication data from a *memcache* server and setting environment variables based on the attributes found in this data. It also allows you to use the default **Apache access control** features to restrict access to your site.

Requisites
----------

[](#requisites)

This module requires you to install and set up the following requirements:

- SimpleSAMLphp running as a [Service Provider](https://simplesamlphp.org/docs/stable/simplesamlphp-sp).
- A *memcache* server.
- [Auth MemCookie](https://zenprojects.github.io/Apache-Authmemcookie-Module/) .

Installation
------------

[](#installation)

Once you have installed SimpleSAMLphp, installing this module is very simple. First of all, you will need to [download Composer](https://getcomposer.org/) if you haven't already. After installing Composer, just execute the following command in the root of your SimpleSAMLphp installation:

```
composer.phar require simplesamlphp/simplesamlphp-module-memcookie:dev-master
```

where `dev-master` instructs Composer to install the `master` branch from the Git repository. See the [releases](https://github.com/simplesamlphp/simplesamlphp-module-memcookie/releases) available if you want to use a stable version of the module.

Configuration
-------------

[](#configuration)

Next thing you need to do is to enable the module:

in `config.php`, search for the `module.enable` key and set `memcookie` to true:

```
    'module.enable' => [ 'memcookie' => true, … ],
```

The first step to use this module is to configure *Auth MemCookie* appropriately. The following example (that you can find also in `extra/auth_memcookie.conf`) might be helpful:

```

    # This is a list of memcache servers which Auth MemCookie
    # should use.
    # Note that this list must list the same servers as the
    # 'authmemcookie.servers'-option in config.php in the
    # configuration for simpleSAMLphp.
    #
    # The syntax for this option is inherited from: http://docs.libmemcached.org/libmemcached_configuration.html
    Auth_memCookie_Memcached_Configuration "--SERVER=127.0.0.1:11211"

    # This must be set to 'on' to enable Auth MemCookie for
    # this directory.
    Auth_memCookie_Authoritative on

    # This adjusts the maximum number of data elements in the
    # session data. The default is 10, which can be to low.
    Auth_memCookie_SessionTableSize "40"

    # These two commands are required to enable access control
    # in Apache.
    AuthType Cookie
    AuthName "My Login"

    # This command causes apache to redirect to the given
    # URL when we receive a '401 Authorization Required'
    # error. We redirect to "/simplesaml/module.php/memcookie/auth.php",
    # which initializes a login to the IdP.
    ErrorDocument 401 "/simplesaml/module.php/memcookie/auth.php"

    # This allows all authenticated users to access the
    # directory. To learn more about the 'Require' command,
    # please look at:
    # http://httpd.apache.org/docs/2.0/mod/core.html#require
    Require valid-user

```

Once *Auth MemCookie* has been correctly configured, you need to configure the module itself by editing the `config/authmemcookie.php` file. Set the `username` configuration option to the name of an attribute that you are sure to receive and that will identify the user unambiguously. Read the instructions in the file itself if you need help to configure it.

If you already have an *auth source* configured and working in SimpleSAMLphp, and all your memcookie configuration options are correct, you are ready to go! Make sure to reload Apache so that it uses the new configuration and *Auth MemCookie* is loaded. Then you can point your browser to the location that you have protected in Apache and it should redirect you automatically to the IdP for authentication.

In order to see all the environment variables you have available in the protected location, you can drop a PHP script like the following in there and access it from your browser after authenticating to your IdP:

```

 $value) {
        echo "   ".htmlspecialchars($key)."".htmlspecialchars($value)."\n";
    }
?>

```

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance62

Regular maintenance activity

Popularity49

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 78.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~338 days

Recently: every ~223 days

Total

10

Last Release

688d ago

PHP version history (3 changes)v1.2.2PHP &gt;=5.6

v1.2.3PHP &gt;=7.4 || ^8.0

v1.3.2PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/579a16ea8afccc6ab420c393f0e573296fe46dcd293aa4f3b71eefc158ebf3e4?d=identicon)[jaime](/maintainers/jaime)

![](https://www.gravatar.com/avatar/9221e348303eeda74e85236a8bff9b919a90d10e3a478fe1cbb9d833f68d0150?d=identicon)[thijskh](/maintainers/thijskh)

![](https://www.gravatar.com/avatar/d424231c85138609ae230ccd5002c8025fd5dce7f51b2f1778f69ba3a49a4efa?d=identicon)[tvdijen](/maintainers/tvdijen)

---

Top Contributors

[![tvdijen](https://avatars.githubusercontent.com/u/841045?v=4)](https://github.com/tvdijen "tvdijen (121 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (18 commits)")[![mcarbonneaux](https://avatars.githubusercontent.com/u/8479023?v=4)](https://github.com/mcarbonneaux "mcarbonneaux (8 commits)")[![jaimeperez](https://avatars.githubusercontent.com/u/1942728?v=4)](https://github.com/jaimeperez "jaimeperez (7 commits)")

---

Tags

cookiesapachesimplesamlphpAuth MemCookie

### Embed Badge

![Health badge](/badges/simplesamlphp-simplesamlphp-module-memcookie/health.svg)

```
[![Health](https://phpackages.com/badges/simplesamlphp-simplesamlphp-module-memcookie/health.svg)](https://phpackages.com/packages/simplesamlphp-simplesamlphp-module-memcookie)
```

###  Alternatives

[drupalauth/simplesamlphp-module-drupalauth

A SimpleSAMLphp module adding support for Drupal as the authentication source.

25305.4k1](/packages/drupalauth-simplesamlphp-module-drupalauth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
