libs/web: Add additional sanity checks to session mechanism