slimphp / Slim-Csrf

Slim Framework CSRF protection middleware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Session filling up

designermonkey opened this issue · comments

Is this supposed to generate a new key => value for every page load?

I am testing a session component and had this middleware activated. Whenever I refresh the page, another pair is added, and none are cleaned up.

Yes. It clears up after 200 iirc - there's a setting for it.

It works this way so that you can open a form in a tab and then browse the site in another tab and not lose the CSRF token for the form

I just read the code and spotted that, thanks.

Guess I should RTFM eh? :D

Feel free to PR an update to the README :)
Though we should probably check the docs on Slim-Website too

I am pretty sure 200 is a bit excessive, but I think that is left for another issue