Here is my problem.
I store array in Laravel session.
session(['array_cache' => $array]);
Array looks like this one:
array:59 [▼ 0 => array:18 [▼ "id" => 2 "type" => 3 "partner_id" => 1 "username" => "Pink11034519" "firstname" => "Jade" "lastname" => "Altenwerth" "age" => 18 "gender" => "f" "email" => "brisa12@lubowitz.com" "mobile" => "406-361-6252 x4876" "rank_id" => 3 "status" => 1 "avatar" => "" "timezone" => "America/Anguilla" "available" => "7:00-11:30 | 13:00-17:00" "created_at" => "2018-08-28 02:56:26" "updated_at" => "2018-09-12 21:03:50" "pivot" => array:3 [▼ "employee_id" => 1 "storable_id" => 2 "storable_type" => "Employee" ] ] 1 => array:18 [▶] 2 => array:18 [▶] 3 => array:18 [▶] .... 57 => array:18 [▶] 58 => array:18 [▶] ]
When I store array like one above with more than 55 elements, session breaks and I get logged out.
If I decrease amount of data in subarrays, I am able to increase number of subarrays stored, before session breaks again.
So, it looks like size matters.
Are there any limits for array size stored in Laravel session?
Or maybe the problem is with Laravel auto serialization?
Anyone came across anything like this?
I appreciate some thoughts.
EDIT: Here's what happened.
As it happens project session is stored in DB.
Standard Laravel session table setup for 'payload' column is TEXT, which comes with: 65,535 chars.
Laravel serializes and base64 encodes session payload. That can quickly eat up allowed chars.
Decision as to changing storage to file is not up to me, so I changed TEXT to MEDIUMTEXT to increase storage capacity, although I am not too happy with potential size of stored string. I will write a memo and closely watch, how it works out.