Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

baloch's avatar

what is the size of my current session?

there are 2 parts of my question.

  1. how can i find out the the current size of the session (in laravel) that i'm using.
  2. what is the maximum size of php session that i can use in laravel? (i searched the stackoverflow and i think the answer to this part is 128MB)
0 likes
3 replies
Snapey's avatar

I don't understand the question. Do you mean the size of the individual session files or the amount of memory in use by php?

baloch's avatar

i'm storing data in session like this and some other data, how can i find out the total size of my current session

$cart = Cart::where('customer_id',$customer->id)->get();
                    Session::put('cart', $cart);
1 like
Snapey's avatar

Look at the files in framework/storage/sessions. This is the serialized version of the session size. Check it before and after you store cart to the session.

I'd be surprised if it was any where near 1MB, and the limit is over 100 times that

Please or to participate in this conversation.