PHPackages                             dennis-kashirin/yii2-session-timeout-warning - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. dennis-kashirin/yii2-session-timeout-warning

ActiveYii2-extension[Mail &amp; Notifications](/categories/mail)

dennis-kashirin/yii2-session-timeout-warning
============================================

Users are warned about expiring session.

1.1.0(6y ago)01941[2 PRs](https://github.com/dennis-kashirin/yii2-session-timeout-warning/pulls)BSD 3-ClausePHP

Since Jun 14Pushed 2y agoCompare

[ Source](https://github.com/dennis-kashirin/yii2-session-timeout-warning)[ Packagist](https://packagist.org/packages/dennis-kashirin/yii2-session-timeout-warning)[ Docs](https://github.com/mg-code/yii2-session-timeout-warning)[ RSS](/packages/dennis-kashirin-yii2-session-timeout-warning/feed)WikiDiscussions master Synced 1mo ago

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

yii2-session-timeout-warning
============================

[](#yii2-session-timeout-warning)

Users are warned about expiring session.

### Differences with original code

[](#differences-with-original-code)

1. Added support of Russian and Ukrainian languages

This is simple implementation of session timeout warning. Plugin does not make any ajax calls, otherwise it would not work with many projects. Components like RBAC are using user identity all time and auth session is renewed every request.

This plugin writes and reads cookies.

It supports multiple tabs. Plugin will not work if user is logged out from server side, or sessions are cleared from database.

If user session is expired, page will be reloaded.

### Install

[](#install)

Either run

```
$ php composer.phar require dennis-kashirin/yii2-session-timeout-warning "@dev"

```

or add

```
"dennis-kashirin/yii2-session-timeout-warning": "@dev"

```

to the `require` section of your `composer.json` file.

### Usage

[](#usage)

1. Register bootstrap class in application config.

```
[
  'bootstrap' => [
      [
          'class' => \mgcode\sessionWarning\components\SessionWarningBootstrap::className(),
          'initMessages' => true,
      ]
  ],
];
```

`initMesscompoages` property initializes translations. Currently only English, Latvian, Russian and Ukrainian languages are supported. Please contribute and add your language.

2. Add controller to controllerMap in application config.

```
[
  'controllerMap' => [
    'session-warning' => [
      'class' => 'mgcode\sessionWarning\controllers\SessionWarningController',
    ],
  ],
];
```

Note: If you are using RBAC, you should allow all visitors to access this controller.

3. Insert widget in layout view.

```

```

Properties:

- `logoutUrl` - if is set, logout button will be shown before Continue button. Default: null
- `extendUrl` - url where ajax request is sent, when continue button is clicked. Default: \['/session-warning/extend'\]
- `warnBefore` - time in seconds before user is warned about expiring session. Default: 300 (5min)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 53.8% 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 ~1148 days

Total

2

Last Release

2471d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2679da8d887af45e6ff40f3cf0d1065c148cc21dcee67c7159dd8734f6d5c7de?d=identicon)[Dennis Kashirin](/maintainers/Dennis%20Kashirin)

---

Top Contributors

[![mg-code](https://avatars.githubusercontent.com/u/1376496?v=4)](https://github.com/mg-code "mg-code (7 commits)")[![dennis-kashirin](https://avatars.githubusercontent.com/u/9320530?v=4)](https://github.com/dennis-kashirin "dennis-kashirin (5 commits)")[![RomanRabirokh](https://avatars.githubusercontent.com/u/3707244?v=4)](https://github.com/RomanRabirokh "RomanRabirokh (1 commits)")

---

Tags

notificationusertimeoutsessionyii2extensionwarningexpire

### Embed Badge

![Health badge](/badges/dennis-kashirin-yii2-session-timeout-warning/health.svg)

```
[![Health](https://phpackages.com/badges/dennis-kashirin-yii2-session-timeout-warning/health.svg)](https://phpackages.com/packages/dennis-kashirin-yii2-session-timeout-warning)
```

###  Alternatives

[kartik-v/yii2-widget-growl

A widget to generate growl based notifications using bootstrap-growl plugin (sub repo split from yii2-widgets)

384.2M14](/packages/kartik-v-yii2-widget-growl)[kartik-v/yii2-widget-alert

A widget to generate alert based notifications using bootstrap-alert plugin (sub repo split from yii2-widgets)

284.1M24](/packages/kartik-v-yii2-widget-alert)[loveorigami/yii2-notification-wrapper

This module for renders a message from session flash (with ajax, pjax support and etc.)

77199.7k5](/packages/loveorigami-yii2-notification-wrapper)[odaialali/yii2-toastr

This is the Toastr extension for Yii 2. It encapsulates Toastr plugin in terms of Yii widgets, and makes ajax notification easy to implement.

1486.3k](/packages/odaialali-yii2-toastr)[diecoding/yii2-toastr

Simple flash toastr notifications for Yii2

1328.8k](/packages/diecoding-yii2-toastr)[cetver/yii2-languages-dispatcher

Sets the web-application language for the Yii framework 2.0

1029.7k](/packages/cetver-yii2-languages-dispatcher)

PHPackages © 2026

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