session[:message]=nil
Is this is the best way to destroy a session variable.
这是销毁会话变量的最佳方式吗?
Note: I dont want to clear all the session variables like reset_session do.
注意:我不想清除所有的会话变量,比如reset_session。
1 个解决方案
#1
197
session.delete(:message)
In general, session variable is SessionHash object, which is inherited from hash.
通常,会话变量是SessionHash对象,它是从hash继承而来的。
#1
197
session.delete(:message)
In general, session variable is SessionHash object, which is inherited from hash.
通常,会话变量是SessionHash对象,它是从hash继承而来的。