Hi Carson,
Those docs had an error, thanks for catching it.
The correct config for config/initializers/session_store.rb is below. Be
sure to generate a random secret of at least 30 characters.:
ActionController::Base.session = {
:namespace => '_dalli-rails2_session',
:secret => '<random_string_of_at_least_30_characters>'
}
require 'action_controller/session/dalli_store'
ActionController::Base.session_store = :dalli_store
And Jason is right-on about using ENV['APP_NAME'] to access the name of your
application in code, although with the above config it isn't necessary.
On Sat, Dec 18, 2010 at 6:59 AM, Carson Gross <[email protected]> wrote:
> Memcached/rube/rails/heroku newb. Apologies in advance.
>
> The docs here: http://docs.heroku.com/memcache give this for the
> memcached config:
>
> # Session cache
> ActionController::Base.session = {
> :namespace => 'sessions',
> :expire_after => 20.minutes.to_i,
> :memcache_server => ['server-1:11211', 'server-2:11211'],
> :key => ...,
> :secret => ...
> }
>
> require 'action_controller/session/dalli_store'
> ActionController::Base.session_store = :dalli_store
>
> First question: is 'server-1' our app url? (
>
> Second question: is there a way to get the name of the current app?
> We run a few versions of our app (staging, production, and, obviously
> locally on our own machines) and I obviously don't want them all going
> to our production memcache instance. What's the orthodox way to
> parameterized the server url, and then is there an orthodox way to
> derive that from the environment?
>
> Thanks,
> Carson
>
> --
> You received this message because you are subscribed to the Google Groups
> "Heroku" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<heroku%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/heroku?hl=en.
>
>
--
Matthew Soldo
Director of Product Management
Heroku, Inc
(415) 323-0003
http://www.linkedin.com/in/mattsoldo
@mattsoldo
--
You received this message because you are subscribed to the Google Groups
"Heroku" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/heroku?hl=en.