@@ -528,7 +528,7 @@ For production applications, consider these external engines:
528528
529529| Engine | Use Case | shard.yml |
530530| --------| ----------| -------|
531- | ** [ Redis] ( https://github.com/neovintage /kemal-session-redis ) ** | High performance, multiple servers | ` neovintage /kemal-session-redis` |
531+ | ** [ Redis] ( https://github.com/crystal-garage /kemal-session-redis-engine ) ** | High performance, multiple servers | ` crystal-garage /kemal-session-redis-engine ` |
532532| ** [ PostgreSQL] ( https://github.com/mang/kemal-session-postgres ) ** | Existing PostgreSQL infrastructure | ` mang/kemal-session-postgres ` |
533533| ** [ MySQL] ( https://github.com/crisward/kemal-session-mysql ) ** | Existing MySQL infrastructure | ` crisward/kemal-session-mysql ` |
534534| ** [ RethinkDB] ( https://github.com/kingsleyh/kemal-session-rethinkdb ) ** | Real-time applications | ` kingsleyh/kemal-session-rethinkdb ` |
@@ -540,21 +540,34 @@ For production applications, consider these external engines:
540540dependencies :
541541 kemal-session :
542542 github : kemalcr/kemal-session
543- kemal-session-redis :
544- github : neovintage /kemal-session-redis
543+ kemal-session-redis-engine :
544+ github : crystal-garage /kemal-session-redis-engin
545545` ` `
546546
547547` ` ` crystal
548548require "kemal"
549549require "kemal-session"
550- require "kemal-session-redis"
550+ require "kemal-session-redis-engine "
551551
552- Kemal::Session.config.engine = Kemal::Session::RedisEngine.new(
553- host : " localhost" ,
554- port : 6379,
555- password : ENV["REDIS_PASSWORD"]?,
556- database : 0
557- )
552+ Kemal::Session.config do |config|
553+ config.cookie_name = "redis_test"
554+ config.secret = "a_secret"
555+ config.engine = Kemal::Session::RedisEngine.new(
556+ " redis://localhost:6379/0?initial_pool_size=1&max_pool_size=10&checkout_timeout=10&retry_attempts=2&retry_delay=0.5&max_idle_pool_size=50" ,
557+ key_prefix : " my_app:session:"
558+ )
559+ config.timeout = Time::Span.new(1, 0, 0)
560+ end
561+
562+ get "/" do
563+ puts "Hello World"
564+ end
565+
566+ post "/sign_in" do |context|
567+ context.session.int("see-it-works", 1)
568+ end
569+
570+ Kemal.run
558571```
559572
560573### Custom Engine
0 commit comments