Fixing issues with CORS sessions