2 ms·
Put some middleware into your web framework that will insert a "secret" into all forms, which contains an unforgeable token generated by the page. Only accept
by nostrademons 17y ago
Put some middleware into your web framework that will insert a "secret" into all forms, which contains an unforgeable token generated by the page. Only accept form input when that secret token matches the expected value.
Django will do this for you; presumably other frameworks have similar mechanisms.
http://docs.djangoproject.com/en/dev/ref/contrib/csrf/ http://docs.djangoproject.com/en/dev/ref/contrib/csrf/