Centos – Laravel/Apache “Bad Request”

apache-2.2centoscookies

I'm playing around with Laravel and implemented the Auth class to create a user registration/login system, i'm using the cookie driver so that members can stay logged in.

But most of the time it will not log me in, and if it does log me in as soon as i click another link i'm logged out.. then eventually i will get this error:

Bad Request

Your browser sent a request that this server could not understand.
Size of a request header field exceeds server limit.
Cookie
/n
Apache/2.2.15 (CentOS) Server at server.localhost.com Port 80

Chrome in particular is stuck on this error but Safari is able to get passed it, i think it's a cookie issue or server mis-configuration

Clearing cookies allows me in once but then the error will appear again.

Best Answer

This'll happen if you're storing too much data in the session.

You can switch to database sessions, but the better move would be to architect your site to store only what's necessary in the session. Session storage isn't intended to store huge arrays of data.

Related Topic