Fixed client to work with cookies and roles