Clearing a Rails Session during Development

人盡茶涼 提交于 2019-12-06 00:07:41

问题


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


回答1:


rake db:sessions:clear



回答2:


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

Otherwise just clear your browser cookies.



来源:https://stackoverflow.com/questions/2175169/clearing-a-rails-session-during-development

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!