CSRF token is null or empty in craft 2 I'm having an issue with Craft 2.6 and the CSRF token. I enabled Csrf Protection in my general.php file by adding this line $config['*'] array so it looks like:

$config['*'] = [
...
    'enableCsrfProtection' =&gt; true,
...
],


I also tried adding this line to the section for // Global variables after this array, but still no luck. I try to attach the token to the window object like this:

&lt;script&gt;
        window.csrfTokenName = "{{ craft.config.csrfTokenName }}";
        window.csrfTokenValue = "{{ craft.request.csrfTokenValue }}";
&lt;/script&gt;


and the window.csrfTokenName = "CRAFT_CSRF_TOKEN"; but window.csrfTokenValue = ""; 

I can't figure out how else to get a csrf token and I can't find any documentation that says anything else. I'm just trying to see if I'm missing something really easy or if there is actually something else I need to add. Any help is greatly appreciated!
For Craft 2, these are the values you're looking for...

window.csrfTokenName = "{{ craft.config.get('csrfTokenName') }}";
window.csrfTokenValue = "{{ craft.request.getCsrfToken }}";


They changed slightly in Craft 3, which can be seen here...