added user and admin session logic