Core: learn it Step 12 of 16 on the Full-Stack Developer roadmap
Session cookies and CSRF
If the frontend and backend share a domain, Django's session cookies work well and are secure by default. Your JavaScript must then send the CSRF token with every request that changes data.