session.js: improved error messages