OpenID nonces and associations need to be visible across all the
servers in the production cluster, so store them in memcache where
everything can see them properly.
-OpenIdAuthentication.store = :file
+if defined?(MEMCACHE_SERVERS)
+ require "openid/store/memcache"
+
+ OpenIdAuthentication.store = OpenID::Store::Memcache.new(MemCache.new(:namespace => "rails", :string_return_types => true))
+else
+ OpenIdAuthentication.store = :file
+end