PHP Session String Limit

Is there a length limit for a string that can be placed in $ _SESSION with PHP?

thank

+3
source share
2 answers

The string size is limited by the amount of memory available on the server. Whether this string can be successfully saved in the session will depend on the session storage engine used.

If you use a ready-made file-based session repository, then most likely you can write a file that is larger than the available memory. If, however, you used, say, memcache, then you could be more limited.

However, in practical terms, if you keep so much in a session, you ask this question, you are probably abusing sessions!

, PHP-, - , . - , .

+7

session_save_handler. , ( , , ), .

, , , , script. .

If you need to save large chunks of data, save them in temporary files (named after the current session).

+2
source

Source: https://habr.com/ru/post/1787132/


All Articles