{"id":15282382,"url":"https://github.com/mipotech/yii2-persistent-session","last_synced_at":"2026-02-12T18:33:00.143Z","repository":{"id":57017316,"uuid":"86428807","full_name":"mipotech/yii2-persistent-session","owner":"mipotech","description":"A Yii2 adaptation of the persistent session technique used by Amazon.com","archived":false,"fork":false,"pushed_at":"2018-05-02T14:41:38.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-07T08:52:26.450Z","etag":null,"topics":["composer-package","session-cookie","yii2","yii2-extension"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mipotech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-28T07:30:15.000Z","updated_at":"2018-05-02T14:40:38.000Z","dependencies_parsed_at":"2022-08-22T11:31:36.237Z","dependency_job_id":null,"html_url":"https://github.com/mipotech/yii2-persistent-session","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mipotech/yii2-persistent-session","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mipotech%2Fyii2-persistent-session","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mipotech%2Fyii2-persistent-session/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mipotech%2Fyii2-persistent-session/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mipotech%2Fyii2-persistent-session/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mipotech","download_url":"https://codeload.github.com/mipotech/yii2-persistent-session/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mipotech%2Fyii2-persistent-session/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29376913,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T18:17:34.915Z","status":"ssl_error","status_checked_at":"2026-02-12T18:17:34.495Z","response_time":55,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer-package","session-cookie","yii2","yii2-extension"],"created_at":"2024-09-30T14:25:29.285Z","updated_at":"2026-02-12T18:33:00.127Z","avatar_url":"https://github.com/mipotech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yii2 Persistent Session\n\nThis package provides a simple way to implement persistent sessions, otherwise known as \"server-side cookies\".\n\n\n## Installation\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nSimply add this line:\n\n```\n\"mipotech/yii2-persistent-session\": \"*\",\n```\n\nto the `require` section of your `composer.json` file and perform a composer update.\n\n## Configuration\n\nAdd `persistentSession` as an application component in @app/config/web.php:\n\n```php\n'components' =\u003e [\n    ...\n    'persistentSession' =\u003e [\n        /* Required settings */\n        'class' =\u003e 'mipotech\\persistentsession\\PersistentSession',\n        \n        /* Optional settings */\n        //'db' =\u003e '...',            // MongoDB application component. Defaults to 'mongodb'\n        //'collection' =\u003e '...',    // The name of the collection to store the session data. Defaults to 'persistent_session'\n        //'cookieClass' =\u003e '...'    // The class to used to generate a new cookie. Defaults to 'yii\\web\\Cookie'\n        //'cookieKey' =\u003e '...',     // The cookie key to use for identifying the persistent session. Defaults to 'session-id'\n        //'cookieParams' =\u003e '...',  // The default cookie parameters. Defaults to ['httpOnly' =\u003e true, 'secure' =\u003e true]\n        //'uniqidPrefix' =\u003e '...',  // The prefix to use for generating a new session identifier. Defaults to ''\n    ]\n    ...\n]\n```\n\nThat's it. The package is set up and ready to go.\n\n## Usage\n\nThe functionality of this component is intended to be as close as possible to native Yii2 sessions ([API documentation](http://www.yiiframework.com/doc-2.0/yii-web-session.html) and [user guide](http://www.yiiframework.com/doc-2.0/guide-runtime-sessions-cookies.html#sessions)).\n\n### Opening and Closing Sessions\n\n```php\n$persistentSession = Yii::$app-\u003epersistentSession;\n\n// check if a session is already open\nif ($persistentSession-\u003eisActive) ...\n\n// open a session\n$persistentSession-\u003eopen();\n\n// destroys all data registered to a session.\n$persistentSession-\u003edestroy();\n```\n\n### Accessing Session Data\n\n\n```php\n$persistentSession = Yii::$app-\u003epersistentSession;\n\n// get a session variable.\n$language = $persistentSession-\u003eget('language');\n\n// set a session variable. The following usages are equivalent:\n$persistentSession-\u003eset('language', 'en-US');\n\n// remove a session variable. The following usages are equivalent:\n$persistentSession-\u003eremove('language');\n\n// check if a session variable exists. The following usages are equivalent:\nif ($persistentSession-\u003ehas('language')) ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmipotech%2Fyii2-persistent-session","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmipotech%2Fyii2-persistent-session","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmipotech%2Fyii2-persistent-session/lists"}