Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
taylorotwell merged 1 commit into
laravel:5.2from
JeroenVanOort:5.2
Jul 20, 2016
Merged

[5.2] Moved up collectGarbage call to run it even when the response throws an exception#14386
taylorotwell merged 1 commit into
laravel:5.2from
JeroenVanOort:5.2

Conversation

@JeroenVanOort
Copy link
Copy Markdown
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