使用 Rack::Session::Cookie 删除当前会话 [英] Deleting the current session with Rack::Session::Cookie

查看:36
本文介绍了使用 Rack::Session::Cookie 删除当前会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我觉得我在这里遗漏了一些明显的东西,我希望一旦我发布这篇文章,就会有人用我遗漏的谷歌搜索链接来羞辱我:-)

I feel like I'm missing something obvious here, and I'm hoping that as soon as I post this someone will shame me with the google search link I was missing :-)

enable :sessions

get '/logout' do
  # What goes here to kill the session?
end

推荐答案

就用

session.clear

销毁会话.

这篇关于使用 Rack::Session::Cookie 删除当前会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆