-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Session is cleared after each request #64
Comments
Can you post an example of the code you're using to cause this error? |
it's something like this module App
class Application < Lotus::Application
configure do
layout :application
load_paths << 'app'
routes 'config/routes'
default_format :json
sessions :cookie, secret: 'mysecret'
controller.prepare do
expose :flash
end
end
def self.root
Pathname.new(File.expand_path(__dir__, '../..')).dirname.realpath
end
end
end
module App::Controllers::Submissions
include App::Controller
class Create
include App::Action
def call(params)
flash[:success] = "OK!"
redirect_to params.env["HTTP_REFERER"]
end
end
end |
Closing in favor of hanami/hanami#110 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello! I faced an error using flash:
undefined method `[]' for nil:NilClass
and it looks like a bug. Further investigation showed that session is cleared after each request in the Lotus::Action::Callable#finish and thus it's no wonder that here is no "__flash" key in the session hash.The text was updated successfully, but these errors were encountered: