Choose either https://example.com or https://www.example.com as canonical and redirect the other. Doing both without a redirect causes duplicate-content confusion and cookie issues.
We can set the redirect at the web server once you confirm the preferred hostname.