Tuesday, 27 August 2013

Rails 3 session variable not deleting right away using cache storage in production

Rails 3 session variable not deleting right away using cache storage in
production

I am using the cache store for session storage in Rails 3. In production
deleting a session variable doesn't seem to be reflected until the request
has completed. That makes sense for cookie storage, but not for cache
storage. Also, this isn't a problem in staging which makes me think it's a
config issue. I'm not sure what config parameter would cause this, though.
Any ideas?
Here's the action code. The variable is cleared because the user can add
more things to the session while the first request is being processed, but
the session variable can't overlap between requests.
id_list = session[:batch_select_ids]
#Clear the session variable
session.delete(:batch_select_ids)
Thanks.

No comments:

Post a Comment