How simply work session ? |
Hello,
I try to use session() but I get this error : {PHP internal code} — CodeIgniter\Debug\Exceptions->shutdownHandler () I want to set session globally in BaseController and simply use session() to set my session. My session is working if I use php superglobal $_SESSION[] but impossible to use session(). Please give me the code to insert into BaseController, normally I can simply put code like this in my controller : session('test')='my test'; echo session('test'); No ? I'm lost trying many many thing !
There's multiple way to get/set session data. Here's some examples, see the links for more details.
Adding session data: http://codeigniter.com/user_guide/librar...ssion-data PHP Code: $newdata = [ Retrieving session data: http://codeigniter.com/user_guide/librar...ssion-data PHP Code: $item = session('item');
What is the actual error message? What you are showing is only the backtrace.
Use the session helper method like this works on all session methods using chaining.
PHP Code: // seesion helper using method chaining. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |