Clearing a Rails Session During Development

How to clear a rails session so that I can start with a fresh slate? I know that I can simply invalidate each of the session variables with session[:my_var] = nil , but is there any rake task or something that knows how to recover session data in its most basic form?

I use Spree and it stores several properties in the session that I would like to clear to see what happens in the background, like order_id , order_token , user_credentials_id , etc.

I am using SQLite3

+7
ruby-on-rails clear
source share
2 answers
 rake db:sessions:clear 
+10
source share

Check your session_store in environment.rb file. You can use "db: sessions: clear" only if it says active_record. In this case, you are dropping the session in db.

Otherwise, just clear your browser cookies.

+7
source share

All Articles