atown99
atown99

Reputation: 109

Missing or incorrect CSRF cookie type

I am using cakephp 4.1 and also xero api. When the user logs in xero is connected . Sometimes this error appears below. My questions is that how do i prevent this and why is this happening? "The problem is this: If a user has the login page tab several days opened in the browser then the cookie expires and this leads to this exception". This is incorrect as i can leave login page open for days and not get this error. I can't reproduce it . How do i detect this error and ow do i fix it. I thought the answer to the post does not solve my problem

Catch "Missing or incorrect CSRF cookie type." exception

Upvotes: 0

Views: 1328

Answers (1)

gourav arora
gourav arora

Reputation: 131

Yes you are correct it should not happen, the way you can reproduce is by manually modifying the cookies from the browser dev tools.

  • Steps to do that (Chrome)
  • Open dev tools (Right-click and click on inspector)
  • Open Application tab
  • Switch to cookies (Choose the domain for which you are setting the cookies)
  • Change the expires field (to past date).

Upvotes: 1

Related Questions