implemented secure persistent sessions