November 2017
Intermediate to advanced
542 pages
14h 24m
English
If CSRF protection is enabled, this tag inserts meta tags containing the CSRF protection token form field, header names, and CSRF protection token value. These meta tags are useful for employing CSRF protection within JavaScript in your applications.
You should place the csrfMetaTags tag within an HTML <head></head> block, where you would normally place other meta tags. Once you use this tag, you can access the form field name, header name, and token value easily using JavaScript, as follows:
<html> <head> ... <sec:csrfMetaTags /> <script type="text/javascript" language="javascript"> var csrfParameter = $("meta[name='_csrf_parameter']").attr("content"); var csrfHeader = $("meta[name='_csrf_header']").attr("content"); ...Read now
Unlock full access