Open Kifsif opened 4 years ago
1) read csrftoken cookie This cookie is set by the Django itself for form csrf protection. In order to save push subscription info (endpoint, keys), UA posts it to the server. And Django view, that writes subscription info to database, checks csrftoken to protect itself from cross site request forgery. https://docs.djangoproject.com/en/3.1/ref/csrf/#ajax
2) read/write push_dnd cookie With django-infopush enabled you will have yourdomain/push/on-off/ url, where any subscriber can opt out from receiving pushes. This url also sets 'push do not disturb' cookie for 1 year, so it will not bother this user with push subscribe window any more. If you wipe this cookie somehow, unsubscribed users will keep receiving 'subscribe to push' browser notification.
3) read/write push_hash cookie This cookie stores hash of a client's push subscription (endpoint, key, auth_secret, timezone), so you can send it to backend only if it's changed. If you wipe this cookie somehow, any client that allowed push on any page load will also do 1 additional ajax post-request to your backend to save push subscription. Everything must be working fine, but this almost doubles requests to backend.
The app uses cookies. Cookies are not cached.
For example, we have a perfectly static page. And we use django_infopush. If I'm not mistaken, two cookies are set: push_hash and csrftoken.
Could you clarify in the documentation everything about cookies. This is very important for many reasons main of which are:
Could you stipulate: