Hi,
I've encountered another problem, which I can't debug on my own. As the title says, I set a session value in a route, but that is not available in the view. For example, in the login route I have:
r.post do
@user = User.first(username: r.params['username'])
if @user && @user.authenticate(r.params['password'])
session[:user_id] = @
user.id flash[:notice] = 'Login successful!'
r.redirect '/users'
else
flash.now[:error] = 'Invalid username or password.'
view('login')
end
end
In my layout.erb the session[:user_id] comes in empty.
I'm using the roda sequel stack and I haven't modified anything about sessions and I don't get any other errors. Am I missing some additional configuration?