PHPackages                             danny3b/cakephp-remember-me - 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. danny3b/cakephp-remember-me

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

danny3b/cakephp-remember-me
===========================

RememberMe plugin for CakePHP

v1.2(9y ago)011MITPHPPHP &gt;=5.5.9

Since Apr 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/danny3b/cakephp-remember-me)[ Packagist](https://packagist.org/packages/danny3b/cakephp-remember-me)[ Docs](https://github.com/narendravaghela/cakephp-remember-me)[ RSS](/packages/danny3b-cakephp-remember-me/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

RememberMe plugin for CakePHP
=============================

[](#rememberme-plugin-for-cakephp)

[![Build Status](https://camo.githubusercontent.com/62a968070ad4ebda6c4329125b045b47b7fc684280e8dbc0142e93ebf23fbdb0/68747470733a2f2f7472617669732d63692e6f72672f6e6172656e64726176616768656c612f63616b657068702d72656d656d6265722d6d652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/narendravaghela/cakephp-remember-me)[![codecov.io](https://camo.githubusercontent.com/6eca4b83c10837e97be2f33ad0988fecf63007f5767aed4bc10656bb1af62212/68747470733a2f2f636f6465636f762e696f2f6769746875622f6e6172656e64726176616768656c612f63616b657068702d72656d656d6265722d6d652f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/github/narendravaghela/cakephp-remember-me?branch=master)

This plugin provides a basic functionality to store user data in Cookies of your CakePHP applications for login and remember user in specific browser.

Read this [blog post](http://blog.narendravaghela.com/2015/01/cakephp-user-login-with-remember-me.html) for detailed example.

Requirements
------------

[](#requirements)

This plugin has the following requirements:

- CakePHP 3.0.0 or greater.
- PHP 5.4.16 or greater.

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

[](#installation)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

```
composer require narendravaghela/cakephp-remember-me

```

After installation, [Load the plugin](http://book.cakephp.org/3.0/en/plugins.html#loading-a-plugin)

```
Plugin::load('RememberMe');
```

Or, you can load the plugin using the shell command

```
$ bin/cake plugin load RememberMe
```

Usage
-----

[](#usage)

To use this, simply load the RememberMe component from this plugin into your AppController or UsersController.

```
$this->loadComponent('RememberMe.RememberMe');
```

You can optionally pass the configuration options for this component.

```
$this->loadComponent('RememberMe.RememberMe', [
    'cypherKey' => "17485937564892755682047369192734583655920926", // Random unuqie string to encrypt/decrypt data. If not set, default salt value of the application will be used.
    'cookieName' => "rememberme", // Name of the cookie.
    'period' => '14 Days' // Time period
]);
```

Here, the basic flow should something like this:

- Find the user from the database
- Validate
- If user has selected "Remember me" checkbox, store the user data using this component.
- Next time, when user (any user) visits the application, check the stored data using `getRememberedData()`.
- Use the data returned by `getRememberedData()` and validate against the database and if everything goes well, create a session of the user and make him logged in.
- If user manually logs out, simply delete the data from Cookie using `removeRememberedData()`.

### Remember data

[](#remember-data)

In your `login` action or the action from where user logs into your application, use the `rememberData()` function and pass the required data of user being logged in.

```
$this->RememberMe->rememberData("data@example.com"); // email address of user being logged in
// or you can use the array as well
$this->RememberMe->rememberData([
  'email' => 'foo@bar.com',
  'someUniqueKey' => 'someuniquevalue'
]);
```

### Get remembered data

[](#get-remembered-data)

Generally, in our `beforeFilter()` callback, we check whether user is logged in or not. Here, we can use `getRememberedData()` to retrieve the data that we have stored in our login action earlier. If we find something, then we can check it against our user table to check whether there is a user or not.

```
$isRemembered = $this->RememberMe->getRememberedData();

// code to check this data against database
// set the session
// ...
```

### Delete data

[](#delete-data)

If you need to remove user data, just call the `removeRememberedData()` and it will delete the data from Cookie.

That is it.

Reporting Issues
----------------

[](#reporting-issues)

If you have a problem with RememberMe, please open an issue on [GitHub](https://github.com/narendravaghela/cakephp-remember-me/issues).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity60

Established project with proven stability

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 ~93 days

Total

3

Last Release

3487d ago

### Community

Maintainers

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

---

Tags

cakephprememberme

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/danny3b-cakephp-remember-me/health.svg)

```
[![Health](https://phpackages.com/badges/danny3b-cakephp-remember-me/health.svg)](https://phpackages.com/packages/danny3b-cakephp-remember-me)
```

###  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)
