0

I want to overwrite public $csrfExpires = '+30 minutes'; in SecurityComponent.php. I want to make the token expire after 14 minutes. So I have added the below code in my controller file.

if (isset($this->Security) && $this->action == 'myAction') {
        $this->Security->csrfExpires = '+14 minutes';
}

But this does not seems to be working. Is there anything else I need to change?

web_developer
  • 71
  • 1
  • 9
  • Have you confirmed that the conditions are try and your update is actually executing? – Greg Schmidt Mar 30 '20 at 21:10
  • yes. I have confirmed that. What is actually happening when the abobe code runs, I believe it will generate a new token key for the form, regardless of the page refresh/reload.Is that right? – web_developer Mar 30 '20 at 21:33

0 Answers0