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
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
It depends how you create your session. Simply you have to nulify session entry. Here is simple example, how to create and destroy sessions.
You can also check this example: https://gist.github.com/131401
Just use
to destroy the session.