We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Sessions are disabled by default. Add the following at the top-level of your app to enable:
enable :sessions
The session Hash is then available in routes, filters, and error handlers:
session
get '/' do session["counter"] ||= 0 session["counter"] += 1 "You've seen this page #{session["counter"]} time(s)" end
The Book includes additional detail on using Sessions:
http://sinatra.github.com/book.html#sessions