Rails: Destroy session with a session_id -
i'm writing gem needs destroy arbitrary session session_id.
currently i'm using following codes
case rails.application.config.session_store when actiondispatch::session::cachestore rails.cache.delete("_session_id:#{session_id}") when actiondispatch::session::activerecordstore activerecord::sessionstore.session_class.find(session_id).destroy when actiondispatch::session::cookiestore # cannot remove client-storage session end
but i've found destroy_session(env, session_id, options)
method every sessionstorage
class. how can call method in script? (not in request or controller)
if you're storing session in db, can try in console:
rake db:sessions:clear
you can destroy whole session following controller:
reset_session
Comments
Post a Comment