如果我使用签名的cookie来保存" session_token"有32个randomed字符,为什么继续使用session?
为例:
def current_user
return nil unless authentication_token = cookies.signed[:authentication_token]
@_current_user ||= User.find_by_authentication_token(authentication_token)
end
def current_user=(user)
return cookies.delete(:authentication_token) if user.nil?
cookies.signed.permanent[:authentication_token] = user.authentication_token
end
使用会话有什么好处?