Created
February 3, 2015 10:32
-
-
Save oakbow/27efc290f757b38fd3b2 to your computer and use it in GitHub Desktop.
herokuでセッションの保存先をRedisにする ref: http://qiita.com/Oakbow/items/98599da0fc62863fc1b8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.configure do | |
: | |
# for session store. | |
config.session_store_servers = 'redis://localhost:6379/0/session' | |
: | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127.0.0.1:6379> keys session* | |
1) "session:f1412e2bbe5df2091ebdf2e3025e2335" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'redis' | |
gem 'redis-rails' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.configure do | |
: | |
# for session store. | |
config.session_store_servers = ENV["REDISCLOUD_URL"] | |
: | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rails.application.config.session_store :cookie_store, key: 'XXXXXX' | |
Rails.application.config.session_store :redis_store, servers: Rails.application.config.session_store_servers, expire_in: BestTeacher::Application.config.session_expires_in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment