PHP - default session processing and user session processing

I have never tried a user session handler so far in PHP, and with me, thinking about the approach to the structure (either CodeIgniter or Kohana), I see that it is possible to use a pre-created user session handler. What are the pros and cons of moving to a system in which session data is stored in a database? How does a custom session handler improve security and maintainability?

One pro that I can think of if you are on a shared web host and the temp folder of the web host is full, trying to open a session may fail. However, if MySQL web hosting leaves, it is no less vain.

Would thank for any advice or recommendations. Thanks!

+3
source share
1 answer

If you go a little deeper into handling default PHP sessions, you will probably find some things that are inaccurate in some way. Just like session time, which is actually very important, but can be inaccurate in some cases (see How long will my session last? And How to end a PHP session in 30 minutes? ).

Therefore, you may need to implement your own session handler that corrects this inaccuracy.

. PHP , , . , . chaches memcached, .

+2

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


All Articles