Sunday, May 21, 2017

Laravel Null Session

Creating a simple captcha with gd library, setting session to be used later on form, but when I want to get the value, it's NULL.

I have put it into web middleware group in routes which has the sessionstart in it.

Inside my captcha controller: session(["captcha"=>$rand]);

Inside my other methods in other controller: $captcha = session("captcha");

dd($captcha); // returns null

Thanks



via simpleCoder

Advertisement