Implemented checkSession on server and on client.