How to empty/destroy a session in rails?

后端 未结 5 2062
执念已碎
执念已碎 2020-12-04 10:40

I can\'t seem to find it anywhere... How do I delete/destroy/reset/empty/clear a user\'s session in Rails? Not just one value but the whole thing..

5条回答
  •  [愿得一人]
    2020-12-04 10:56

    To clear only certain parameters, you can use:

    [:param1, :param2, :param3].each { |k| session.delete(k) }
    

提交回复
热议问题