views:

186

answers:

2

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

I'm using Spree and it stores a few properties in the session that I would like to clear out to see what's going on in the background, such as order_id, order_token, user_credentials_id, etc.

I'm using SQLite3

A: 
rake db:sessions:clear
JRL
when I run that I get: rake aborted!SQLite3::SQLException: no such table: sessions: DELETE FROM sessions. I've run rake db:migrate and all that already, so everything's in there
viatropos
Then you're probably not using the database for your session data. If you're using just cookies you could just clear your cookies in your browser.
JRL
Look at `ActionController::Base.session_store` in `session_store.rb`
JRL
A: 

check your session_store in your environment.rb file. you can use the "db:sessions:clear" only if it says active_record, in which case you are dumping ur session in db. else just clear ur browser cookies.

KCore