Maximum size of a PHP session

PhpSessionSizeMax

Php Problem Overview


What is the maximum size that can be stored in a PHP session?

Php Solutions


Solution 1 - Php

You can store as much data as you like within in sessions. All sessions are stored on the server. The only limits you can reach is the maximum memory a script can consume at one time, which by default is 128MB.

(Similar answers: Ideal PHP Session Size? - some useful comments)

Solution 2 - Php

This is limited by max file size of your operating system (if storing session to file) or column size (if storing session to database).

Using custom handlers, it is possible to have a session file that is greater in size than the amount set in memory_limit.

Therefore, it is a combination of max file/column size and memory limit.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRochView Question on Stackoverflow
Solution 1 - PhpRuduView Answer on Stackoverflow
Solution 2 - PhpwebbiedaveView Answer on Stackoverflow