Improve cookie handling; remove cookies on logout