I have to process a web page. This web page is based on YII framework
, and the login page is protected by CSRF tokens
. When I pass the login credentials by POST method
. I get the error 400
and The CSRF token could not be verified
message.
I don't know how to by pass this protection. I don't understand the mechanism. When I login by the Chrome browser, I see what the POST message look like. It has 4 parameters: CSRF key, login, password, an one empty variable. How the browser gets the proper CSRF key to be sanded back?
I have a login and password for this web page, and I can login as normal user. Only the login page is protected against CSRF. Can I use the cookie (how to do that) created by browser on normal login, give this cookie to cURL
and start processing URLs
behind login page?