Support the ongoing development of →
posted 9 years ago
Last updated 1 year ago.

Quick look at the source code suggests not, although Sessions and Cookies are probably the two most difficult things to follow through the application in laravel.

This actually makes sense, because if you were able to access Cookie's via that getter, it would completely destroy any of the security the encryption provides, as i could simply replace an encrypted cookie with a plain text one, and laravel would treat it just the same.

What your asking for would require the application to have an array of protected cookie keys in its config, to enforce encryption or require the developer to check if the cookie was plaintext or encrypted before trusting it. Which is not really what laravel is about. Laravel will give you as much config as it can, but it will generally always favour simplicity and convention over configuration.

With all that said, theres nothing wrong with using $_COOKIE, we don't need classes with getters and setters for every basic thing in PHP.

Last updated 1 year ago.

Sign in to participate in this thread!


Your banner here too?

mahenn mahenn Joined 5 Aug 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.