PHPackages                             mg-code/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. mg-code/yii2-session-timeout-warning

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

mg-code/yii2-session-timeout-warning
====================================

Users are warned about expiring session.

1.1.0(6y ago)514.3k—2.9%10[3 issues](https://github.com/mg-code/yii2-session-timeout-warning/issues)BSD 3-ClausePHP

Since Jun 14Pushed 6y ago3 watchersCompare

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

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

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

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

Users are warned about expiring session.

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 mg-code/yii2-session-timeout-warning "@dev"

```

or add

```
"mg-code/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 and Latvian 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

33

—

LowBetter than 72% of packages

Maintenance8

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 87.5% 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

2523d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1376496?v=4)[Māris Graudiņš](/maintainers/mg-code)[@mg-code](https://github.com/mg-code)

---

Top Contributors

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

---

Tags

notificationusertimeoutsessionyii2extensionwarningexpire

### Embed Badge

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

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

###  Alternatives

[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13825.8k59](/packages/skeeks-cms)[kartik-v/yii2-widget-growl

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

424.4M14](/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)

304.2M24](/packages/kartik-v-yii2-widget-alert)[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.

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

Simple flash toastr notifications for Yii2

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

Sets the web-application language for the Yii framework 2.0

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

PHPackages © 2026

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