Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Default CSRF validation with django #20

tiagob opened this Issue · 5 comments

2 participants


In heavy_data.js your overriding the cookie which is used for CSRF in django forms.

Form submission fails with:
Forbidden (403)
CSRF verification failed. Request aborted.

Reason given for failure:
CSRF cookie not set.


Can you please provide more details? I did not see this problem before.


I have 188 selected values. I'm using google chrome. It seems that my document.cookie can only take 75 of them before it starts replacing the ones it just set and the csrf token too in setCookie in heavy_data.js.


I got it working by replacing the cookie code in heavy_data.js with


Oops. Good catch! Yes there is usually a max limit of 4KB limit on cookies. In your case you are hitting that at 75 elements. I will incorporate your suggestion in heavy_data.js.


Please update to latest version. Noe django_select2 does not use cookies or localStorage at all.

@applegrew applegrew closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.