I am using Ruby and Sinatra to develop an application.
I use
enable :sessions
in order to use the session variable provided by rack. How can I make all of the session cookies be HTTPOnly? Is it like this by default? I can’t find any documentation on this.
Instead of
enable :sessions:I’d suggest using the encrypted_cookie gem instead, it’s far more secure. As an example, here’s what I’ll probably have for a project:
(To clarify why I’ve laid it out this way – this kind of stucture allows me to split the app up and use it easier in tests by just requiring the app/config.rb. YMMV)