Added session control and sanitization