{"id":44960196,"url":"https://github.com/crystal-garage/kemal-session-redis-engine","last_synced_at":"2026-02-18T13:03:06.366Z","repository":{"id":108958051,"uuid":"562787984","full_name":"crystal-garage/kemal-session-redis-engine","owner":"crystal-garage","description":"Redis store for kemal-session","archived":false,"fork":false,"pushed_at":"2026-02-11T14:02:36.000Z","size":56,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-11T17:56:13.738Z","etag":null,"topics":["crystal","kemal","redis","session"],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"neovintage/kemal-session-redis","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crystal-garage.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-11-07T09:02:54.000Z","updated_at":"2026-02-11T14:02:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/crystal-garage/kemal-session-redis-engine","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/crystal-garage/kemal-session-redis-engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-garage%2Fkemal-session-redis-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-garage%2Fkemal-session-redis-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-garage%2Fkemal-session-redis-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-garage%2Fkemal-session-redis-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crystal-garage","download_url":"https://codeload.github.com/crystal-garage/kemal-session-redis-engine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-garage%2Fkemal-session-redis-engine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29580647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T08:38:15.585Z","status":"ssl_error","status_checked_at":"2026-02-18T08:38:14.917Z","response_time":162,"last_error":"SSL_read: 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":["crystal","kemal","redis","session"],"created_at":"2026-02-18T13:03:05.529Z","updated_at":"2026-02-18T13:03:06.348Z","avatar_url":"https://github.com/crystal-garage.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kemal-session-redis-engine\n\n[![CI](https://github.com/crystal-garage/kemal-session-redis-engine/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/crystal-garage/kemal-session-redis-engine/actions/workflows/ci.yml)\n[![GitHub release](https://img.shields.io/github/release/crystal-garage/kemal-session-redis-engine.svg)](https://github.com/crystal-garage/kemal-session-redis-engine/releases)\n[![License](https://img.shields.io/github/license/crystal-garage/kemal-session-redis-engine.svg)](https://github.com/crystal-garage/kemal-session-redis-engine/blob/main/LICENSE)\n\nRedis session store for [kemal-session](https://github.com/kemalcr/kemal-session) implemented with [jgaskins/redis](https://github.com/jgaskins/redis) client.\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  kemal-session-redis-engine:\n    github: crystal-garage/kemal-session-redis-engine\n```\n\n## Usage\n\n```crystal\nrequire \"kemal\"\nrequire \"kemal-session\"\nrequire \"kemal-session-redis-engine\"\n\nKemal::Session.config do |config|\n  config.cookie_name = \"redis_test\"\n  config.secret = \"a_secret\"\n  config.engine = Kemal::Session::RedisEngine.new(\n    \"redis://localhost:6379/0?initial_pool_size=1\u0026max_pool_size=10\u0026checkout_timeout=10\u0026retry_attempts=2\u0026retry_delay=0.5\u0026max_idle_pool_size=50\",\n    key_prefix: \"my_app:session:\"\n  )\n  config.timeout = Time::Span.new(1, 0, 0)\nend\n\nget \"/\" do\n  puts \"Hello World\"\nend\n\npost \"/sign_in\" do |context|\n  context.session.int(\"see-it-works\", 1)\nend\n\nKemal.run\n```\n\nThe engine comes with a number of configuration options:\n\n| Option     | Description                                                                                    |\n| ---------- | ---------------------------------------------------------------------------------------------- |\n| redis_url  | where your redis instance lives. defaults to `redis://localhost:6379/0`                        |\n| key_prefix | when saving sessions to redis, how should the keys be namespaced. defaults to `kemal:session:` |\n\nIf no options are passed the `RedisEngine` will try to connect to a Redis using\ndefault settings.\n\n## Best Practices\n\n### Creating a Client\n\nIt's very easy for client code to leak Redis connections and you should\npass a pool of connections that's used throughout Kemal and the\nsession engine.\n\n### Session Administration Performance\n\n`Kemal::Session.all` and `Kemal::Session.each` perform a bit differently under the hood. If\n`Kemal::Session.all` is used, the `RedisEngine` will use the `SCAN` command in Redis\nand page through all of the sessions, hydrating the Session object and returing\nan array of all sessions. If session storage has a large number of sessions this\ncould have performance implications. `Kemal::Session.each` also uses the `SCAN` command\nin Redis but instead of creating one large array and enumerating through it,\n`Kemal::Session.each` will only hydrate and yield the keys returned from the current\ncursor. Once that block of sessions has been yielded, RedisEngine will retrieve\nthe next block of sessions.\n\n## Development\n\nRedis must be running on localhost and bound to the default port to run\nspecs.\n\n## Contributing\n\n1. Fork it ( https://github.com/crystal-garage/kemal-session-redis-engine/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create a new Pull Request\n\n## Contributors\n\n- [[mamantoha](https://github.com/mamantoha)] Anton Maminov - maintainer\n- [[neovintage](https://github.com/neovintage)] Rimas Silkaitis - creator, maintainer\n- [[crisward](https://github.com/crisward)] Cris Ward\n- [[fdocr](https://github.com/fdocr)] Fernando Valverde\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystal-garage%2Fkemal-session-redis-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrystal-garage%2Fkemal-session-redis-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystal-garage%2Fkemal-session-redis-engine/lists"}