The Slim Framework support forum has moved to This Tender forum is no longer maintained or monitored.

CSRF token not working for POST method. Works for PUT

Michael's Avatar


19 Feb, 2016 11:48 PM


I'm having difficulty getting the csrf token to work for POST methods. I am using angular and setting the csrf name and value in the request payload object. It works fine for my PUT methods, but when I use POST I am receiving a 500 server internal error with zero information other than that. I have even tried including the csrf name and value into the request header with no luck. The documentation is sort of vague on how to properly implement csrf tokens. I have tried writing a template with hidden inputs, but it does not seem to play nice with my angular/grunt setup on my localhost a.k.a does not appear probably due to the views in angular. I would appreciate any help that I can get.

General example of how I am using the tokens:

AuthService.getToken().then(function (token) { /////////////////////////GETS TOKEN NAME AND VALUE FINE

$scope.newStat.csrf_name = $scope.tokenName;
$scope.newStat.csrf_value = $scope.tokenVal;$scope.newStat).then(function (data) { //////////////THIS DOES NOT WORK-500 INTERNAL SERVER ERROR
            $scope.currentStats.push(data); ///////////ALSO HAVE TRIED ADDING HIDDEN INPUT IN MAIN.HTML WITH TOKEN DATA PER EXAMPLE

selectedStat.csrf_name = $scope.tokenName;
selectedStat.csrf_value = $scope.tokenVal;

Thank you,


  1. 1 Posted by sagarkhna999 on 09 May, 2016 10:52 AM

    sagarkhna999's Avatar

    good Touch the Pen switch to look at the color slider. the display screen with another ring finger to transition between surveillance cameras. nice.

  2. 2 Posted by dhoni on 15 Nov, 2016 07:23 AM

    dhoni's Avatar

    awesome Vidmate Apk Download: Fighting to locate a very than its rivals like Snap Tube and Television Teammate nice.

  3. 3 Posted by Gloria on 17 Feb, 2017 06:46 AM

    Gloria 's Avatar

    awesome with exactly how you could shield your pc from the strike of versus the ARP spoofing strike you just have to check package nice.

  4. 4 Posted by cerjo on 06 Jun, 2017 10:41 AM

    cerjo's Avatar

    And also similarly, its has likewise many pros You will see this choice in the "Application" or "Security" updates.

  5. 5 Posted by kuldeep on 02 Sep, 2017 07:27 AM

    kuldeep's Avatar

    check this awesome guide to know how to get things done

  6. 6 Posted by rebeccahickshq on 05 Oct, 2017 01:32 AM

    rebeccahickshq's Avatar

    I appreciate it!. I really like it when people get together and share ideas. Great website, continue the good work!. Either way, great web and I look forward to seeing it grow over time. Thank you so much. |=>super smash flash 2 |=>bloons tower defense 5

  7. 7 Posted by Ramesh on 26 Mar, 2018 05:05 PM

    Ramesh's Avatar

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac