PHPackages                             iiifx-production/yii2-secure-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. iiifx-production/yii2-secure-remember-me

ActiveExtension[Authentication &amp; Authorization](/categories/authentication)

iiifx-production/yii2-secure-remember-me
========================================

Yii2 Secure RememberMe

v1.1.0(7y ago)3394—0%1MIT LicensePHPPHP ^7.0

Since Aug 28Pushed 7y ago1 watchersCompare

[ Source](https://github.com/iiifx-production/yii2-secure-remember-me)[ Packagist](https://packagist.org/packages/iiifx-production/yii2-secure-remember-me)[ Docs](https://github.com/iiifx-production/yii2-secure-remember-me)[ RSS](/packages/iiifx-production-yii2-secure-remember-me/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (5)Used By (0)

Yii2 Secure RememberMe
======================

[](#yii2-secure-rememberme)

**Secure RememberMe** - расширение для фреймворка Yii2, реализующее безопасный способ RememberMe-аутентификации по токену в Cookie.

Установка
---------

[](#установка)

Используя Composer:

```
$ composer require "iiifx-production/yii2-secure-remember-me"
```

Миграции
--------

[](#миграции)

Выполнить в консоли:

```
$ php yii migrate --migrationPath=@vendor/iiifx-production/yii2-secure-remember-me/source/migrations
```

Настройка
---------

[](#настройка)

Прописать в конфигурации config/main.php:

```
    'bootstrap' => [

        /* ... */

        'rememberMe', # Добавляем к загрузочным компонентам приложения
    ],

    'components' => [
        'rememberMe' => [ # Добавляем компонент в приложение
            'class' => 'iiifx\yii2\SecureRememberMe\components\Manager',
            # Конфигурация компонента
            'cookieKey' => 'remember-me', # Имя Cookie параметра
            'lifetime' => 2592000, # Время жизни токена, в секундах
            'userClass' => 'common\models\User', # Класс пользователя, который используется в приложении
        ],

        /* ... */

    ],
```

Использование
-------------

[](#использование)

### Пример подключения расширения к **[Yii2 Advanced Template](https://github.com/yiisoft/yii2-app-advanced)**.

[](#пример-подключения-расширения-к-yii2-advanced-template)

Вносим изменения в логику входа([LoginForm::login()](https://github.com/yiisoft/yii2-app-advanced/blob/master/common/models/LoginForm.php#L56)):

```
    /**
     * Logs in a user using the provided username and password.
     *
     * @return boolean whether the user is logged in successfully
     */
    public function login ()
    {
        if ( $this->validate() ) {
            if ( Yii::$app->user->login( $this->getUser() ) ) {

                # Если разрешен RememberMe пользователем
                if ( $this->rememberMe ) {
                    /** @var \iiifx\yii2\SecureRememberMe\components\Manager $rememberMe */
                    $rememberMe = Yii::$app->rememberMe;
                    # Создаем токен для пользователя
                    $rememberMe->create( $this->_user->id );
                }
                return TRUE;

            }
        }
        return FALSE;
    }
```

И добавляем удаление токена при выходе([SiteController::actionLogout()](https://github.com/yiisoft/yii2-app-advanced/blob/master/frontend/controllers/SiteController.php#L104)):

```
    /**
     * Logs out the current user.
     *
     * @return mixed
     */
    public function actionLogout()
    {
        Yii::$app->user->logout();

        /** @var \iiifx\yii2\SecureRememberMe\components\Manager $rememberMe */
        $rememberMe = Yii::$app->rememberMe;
        $rememberMe->delete();

        return $this->goHome();
    }
```

Проверка, аутентификация по токену и его регенерация происходит автоматически.

Все. Компонент готов к работе.

Тесты
-----

[](#тесты)

@TODO

Лицензия
--------

[](#лицензия)

[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~627 days

Total

3

Last Release

2661d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.5

v1.1.0PHP ^7.0

### Community

Maintainers

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

---

Top Contributors

[![iiifx](https://avatars.githubusercontent.com/u/3157964?v=4)](https://github.com/iiifx "iiifx (4 commits)")

---

Tags

secureyii2loginremember-merememberme

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/iiifx-production-yii2-secure-remember-me/health.svg)

```
[![Health](https://phpackages.com/badges/iiifx-production-yii2-secure-remember-me/health.svg)](https://phpackages.com/packages/iiifx-production-yii2-secure-remember-me)
```

###  Alternatives

[auth0/auth0-php

PHP SDK for Auth0 Authentication and Management APIs.

40820.2M68](/packages/auth0-auth0-php)[auth0/login

Auth0 Laravel SDK. Straight-forward and tested methods for implementing authentication, and accessing Auth0's Management API endpoints.

2745.0M3](/packages/auth0-login)[auth0/symfony

Symfony SDK for Auth0 Authentication and Management APIs.

128738.1k](/packages/auth0-symfony)[auth0/wordpress

WordPress Plugin for Auth0

17419.5k](/packages/auth0-wordpress)

PHPackages © 2026

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