+ 2
Storing arrays into sessions Php
Can anybody please explain to my understanding how to store arrays into sessions. An example. Storing e-commerce data into sessions
1 ответ
+ 2
Storing an array in $_SESSION is like storing any other data type in it.
This article gives more detailed explaination and an example.
https://thisinterestsme.com/store-array-session-php/
Don't forget to always run session_start() exactly once for every HTTP request you want to use $_SESSION and do this before sending any content other than headers. This is critical for any use of $_SESSION because it initializes $_SESSION. Forgetting to call session_start is a very common mistake.