{"id":37235894,"url":"https://github.com/imarc/craft-dbsessions","last_synced_at":"2026-01-16T04:51:25.941Z","repository":{"id":56990244,"uuid":"104507095","full_name":"imarc/craft-dbsessions","owner":"imarc","description":"A database session handler built for Craft CMS 2.x","archived":false,"fork":false,"pushed_at":"2020-12-03T19:43:00.000Z","size":7,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-06-10T18:28:35.790Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imarc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-22T18:40:33.000Z","updated_at":"2020-12-03T19:41:15.000Z","dependencies_parsed_at":"2022-08-21T13:50:18.227Z","dependency_job_id":null,"html_url":"https://github.com/imarc/craft-dbsessions","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/imarc/craft-dbsessions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imarc%2Fcraft-dbsessions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imarc%2Fcraft-dbsessions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imarc%2Fcraft-dbsessions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imarc%2Fcraft-dbsessions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imarc","download_url":"https://codeload.github.com/imarc/craft-dbsessions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imarc%2Fcraft-dbsessions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2026-01-15T04:04:59.803Z","updated_at":"2026-01-15T04:05:00.374Z","avatar_url":"https://github.com/imarc.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Craft DB Sessions Handler\n\nFor Craft 2.x. Sets up a database sesssion handler using Craft's \nexisting DB and Caching libraries to ensure that only a single \ndatabase connection is ever created.\n\nThis is not a true Craft plugin, but is best distributed as one.\n\n## Installation\n\nInstall through composer (recommended):\n\n    composer require imarc/craft-dbsessions\n\nAlternatively place all files into a `craft/plugins/dbsessions` directory.\n\n## Usage\n\nAdd the following at the very top of your `public/index.php` file:\n\n    require __DIR__ . '/../craft/plugins/dbsessions/SessionHandler.php';\n    \\Imarc\\CraftDatabaseSessions\\SessionHandler::register();\n\nYour sessions will now be stored in craft's database instead of on the filesystem.\n\nThe `dbsessions_sessions` database table used by this library *should* be created automatically. If there\nare restrictive database permissions, you can use the following migration to create the table manually:\n\n```(sql)\nCREATE TABLE dbsessions_sessions (\n    id char(128) NOT NULL PRIMARY KEY,\n    expire int(11) NULL,\t \n    value longblob NULL\n);\n```\n\n## Why?\n\nSometimes, in an high-availability environment with multiple application servers, storing the sessions \ndirectly on the filesystem is not ideal as there is no consistency to which application server\nan end-user is hitting. **Redis or Memcached is recommended over using the DB for sessions** as Craft can \nwork with those out of the box, but DB is fine if those services aren't available for whatever reason.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimarc%2Fcraft-dbsessions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimarc%2Fcraft-dbsessions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimarc%2Fcraft-dbsessions/lists"}