Fixes for the sessions module so that it works with sqlite3_extended_error_codes() set.