PHPackages                             phantomwatson/cakephp-autologin - 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. phantomwatson/cakephp-autologin

ActiveCakephp-plugin[Authentication &amp; Authorization](/categories/authentication)

phantomwatson/cakephp-autologin
===============================

CakePHP AutoLogin Component

v1.1.1(8y ago)38.7k[1 PRs](https://github.com/PhantomWatson/CakePHP-AutoLoginComponent/pulls)MITPHPCI passing

Since Apr 30Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/PhantomWatson/CakePHP-AutoLoginComponent)[ Packagist](https://packagist.org/packages/phantomwatson/cakephp-autologin)[ Docs](https://github.com/PhantomWatson/CakePHP-AutoLoginComponent)[ RSS](/packages/phantomwatson-cakephp-autologin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (7)Used By (0)

CakePHP AutoLogin Component
===========================

[](#cakephp-autologin-component)

[![Build Status](https://camo.githubusercontent.com/9713339afcda5c3a3a9fa339ed6d2fad04eab3a6dc5e678030577e5123adfb75/68747470733a2f2f7472617669732d63692e6f72672f5068616e746f6d576174736f6e2f43616b655048502d4175746f4c6f67696e436f6d706f6e656e742e7376673f6272616e63683d646576656c6f706d656e74)](https://travis-ci.org/PhantomWatson/CakePHP-AutoLoginComponent)

This uses CakePHP's Cookie component in order to store a user's login data and automatically restore any sessions after they expire.

Compatibility:
--------------

[](#compatibility)

Tested in CakePHP 3.0.0. This component will not work with CakePHP versions 1.x or 2.x.

Installation:
-------------

[](#installation)

**Manual installation:**

- Download this repository and add its contents to `plugins/AutoLogin`

**Or with Composer:**

- Run `composer require phantomwatson/cakephp-autologin` in your application root

**Then:**

- Add `Plugin::load('AutoLogin');` to your application's `bootstrap.php` (unless if you're already using `Plugin::loadAll();`)
- Add `$this->loadComponent('AutoLogin.AutoLogin');` to `AppController::initialize()` after `$this->loadComponent('Auth')`
- Add `$this->AutoLogin->setCookie();` after `$this->Auth->setUser($user);` wherever you log your users in
- Add `$this->AutoLogin->destroyCookie();` where you log your users out (e.g. in `UsersController::logout()`)

Configuration:
--------------

[](#configuration)

This component takes the following options:

- **autoLogin** - If true, attempts to logs the user in with cookie data. (Default: `true`)
- **cookieKey** - The name of the variable that the user's AutoLogin data is placed under in the cookie. (Default: `'autoLogin'`)
- **cookieSettings** - An array of [cookie configuration settings](http://book.cakephp.org/3.0/en/controllers/components/cookie.html#configuring-cookies) for overriding the existing cookie configuration for the AutoLogin cookie variable. Possible options: 'expires', 'path', 'domain', 'secure', 'key', 'httpOnly', and 'encryption'. (Default: `[]`)
- **fields** - The field names relevant to user authentication in your application. If your password field is called `'pass'`, you'll need to change this to something like `['username', 'pass']`. (Default: `['email', 'username', 'password']`)

For information about how to set these options, visit the [Configuring Components](http://book.cakephp.org/3.0/en/controllers/components.html#configuring-components) section of the CakePHP 3 docs.

Note that these settings **must be set in your controller's `initialize()` method**, because AutoLogin cookie configuration and session restoration both take place before your controller's `beforeFilter()` method fires.

Notes:
------

[](#notes)

It is **strongly recommended** that you use encrypted cookies. CakePHP 3 uses AES-encrypted cookies by default, so this just means *don't turn off cookie encryption*.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance60

Regular maintenance activity

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 96.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 ~392 days

Total

3

Last Release

3252d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c85adcea1d9b9f8f2d3062fa6b312aa0759b09bf8613e9fad84e21d169b3398?d=identicon)[PhantomWatson](/maintainers/PhantomWatson)

---

Top Contributors

[![PhantomWatson](https://avatars.githubusercontent.com/u/1965565?v=4)](https://github.com/PhantomWatson "PhantomWatson (28 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

cakephpautologin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phantomwatson-cakephp-autologin/health.svg)

```
[![Health](https://phpackages.com/badges/phantomwatson-cakephp-autologin/health.svg)](https://phpackages.com/packages/phantomwatson-cakephp-autologin)
```

###  Alternatives

[cakedc/users

Users Plugin for CakePHP

524897.0k16](/packages/cakedc-users)[dereuromark/cakephp-tinyauth

A CakePHP plugin to handle user authentication and authorization the easy way.

129228.6k10](/packages/dereuromark-cakephp-tinyauth)[admad/cakephp-jwt-auth

CakePHP plugin for authenticating using JSON Web Tokens

160680.3k8](/packages/admad-cakephp-jwt-auth)[markstory/acl_extras

Additional tools for managing DB ACL in CakePHP applications.

155311.0k](/packages/markstory-acl-extras)[cakedc/auth

Auth objects for CakePHP

31630.0k2](/packages/cakedc-auth)[uafrica/oauth-server

OAuth Server for CakePHP 3 using the PHP League's OAuth2 Server

5172.1k](/packages/uafrica-oauth-server)

PHPackages © 2026

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