Add warning for situation that session is not created. Make it easy for trouble shooting when the captcha failed to verify in this situation.
Sometimes, request for some simple pages in your Rails application may not create a session, as the session in Rails is created lazily. It will be created when it is explicitly used, for example:
If not, you can get #<ActionDispatch::Request::Session:0x7f9b28a670c8 not yet loaded> when called session in controller. And the session key you seted will not exist in broswer.
Rucaptcha use the session to distinguish the user or current captcha. So you need ensure the session is exist, when use Rucaptcha. Otherwise, it will let you in trouble.
Add warning for situation that session is not created. Make it easy for trouble shooting when the captcha failed to verify in this situation.
Sometimes, request for some simple pages in your Rails application may not create a session, as the session in Rails is created lazily. It will be created when it is explicitly used, for example:
or
If not, you can get
#<ActionDispatch::Request::Session:0x7f9b28a670c8 not yet loaded>
when calledsession
in controller. And the session key you seted will not exist in broswer.Rucaptcha use the session to distinguish the user or current captcha. So you need ensure the session is exist, when use Rucaptcha. Otherwise, it will let you in trouble.