- Use Twig {{ csrf_token() }} and {{ csrf_hash() }} helpers - Remove invalid PHP syntax from JS - Add getCsrfData() helper function