Refine the error messages and add feature to extend session lifetime.