5

I've upgraded Laravel from 4.0 to 4.1. My application sets Cookies, which I also use in javascript. Now they get automatically encrypted, thus not readable anymore in javascript. I can't find how to disable the encryption for particular cookies When I try to set them with PHP setcookie native function, they don't persist.

Is there a solution for this?

Ernie
  • 972
  • 1
  • 10
  • 23
  • What about `Crypt::decrypt($encryptedValue);` ? – egig Apr 04 '14 at 07:36
  • The problem is I can't set cookies that are not encrypted. Cookies that are set with Laravels Cookie::make() are encrypted automatically, Cookies set with native setcookie() function are completely discarded – Ernie Apr 04 '14 at 07:58
  • 1
    For laravel 5 the solution is here: http://stackoverflow.com/questions/35029385/unencrypted-cookie-in-laravel – Mihai Scurtu May 27 '16 at 22:34
  • There is a hacky way, example given in this GitHub issue: https://github.com/laravel/framework/issues/3440 – Andreas Apr 04 '14 at 08:53

1 Answers1

1

I fixed it setting the cookies with php native function setcookie in the app::after filter. In each request I re-set the cookies because laravel clears them while processing the request.

Ernie
  • 972
  • 1
  • 10
  • 23