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
Skip deserialisation if no session content #5
Comments
The module already does this, and the warning you see is the "bailing gracefully" when the session could not be deserialized : https://github.com/LoonyPandora/Dancer-Session-DBI/blob/master/lib/Dancer/Session/DBI.pm#L187-L192 I don't think there is a more graceful way to do it. |
I wonder if a warning is really necessary? Not finding a session with a given session ID will be a pretty common thing in a busy app - just people hitting the app with an expired session ID, say. Maybe it should be at debug level instead? (Also, checking for session data before attempting to deserialize it would at least silence the JSON deserialisation part of the error, which is the scarier part which makes it sound like something is broken, rather than a routine situation being handled as designed.) |
Hmm, yeah making it a debug level warning would be nicer. I'll get on it :) |
No check is made to see if any session data was actually retrieved before trying to deserialise it, leading to the following mildly irritating error in the logs:
It would make sense, I think, to check whether you got any session data, and if not, bail gracefully there before attempting to deserialise.
The text was updated successfully, but these errors were encountered: