Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2] Moved up collectGarbage call to run it even when the response throws an exception #14386

Merged
merged 1 commit into from
Jul 20, 2016

Conversation

JeroenVanOort
Copy link
Contributor

Lately, we've been seeing a type of attack where the attacker tries to make as much sessions as possible, which can cause a server to run out of disk space. Because the requests are empty POST's, they throw a TokenMismatchException. When this happens on a website that doesn't see much traffic, the garbage collector is rarely run, so the old session files are rarely deleted.

To fix this, I've moved the collectGarbage call to above the point where any exception might be thrown.

@taylorotwell taylorotwell merged commit 7dfb945 into laravel:5.2 Jul 20, 2016
@GrahamCampbell GrahamCampbell changed the title moved up collectGarbage call to run it even when the response throws an exception [5.2] Moved up collectGarbage call to run it even when the response throws an exception Jul 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants