As every resource you need to understand it completely, read all documentation and eventually look for undocumented information. Something complex like this can have a lot of details that can go unnoticed. I will not try to put everything that needs to be checked, not least because I am not an expert on the subject, and I do not think it fits, my intention is not to give a definitive answer.
The main reason for frameworks providing mechanisms for any technology is the abstraction of the resource.
Abstraction is one of the most misunderstood concepts in computing. It has always existed before modern computers even existed. Abstraction gives more meaning to what is being done and puts a layer on top of the concrete, allowing the actual implementation to be hidden from the user of that resource.
One of the biggest advantages of abstraction is that if it is done well it can change the implementation without requiring the codes that use it to be modified. This is very important in several scenarios. It is not always possible to do well, no matter how good the programmer. And not always the complication of abstraction that will be necessary is worth the effort.
So it’s interesting that these products have a shape that at least does not depend on the PHP standard.
And since the standard has a relatively simple and fixed implementation it is natural that they provide a more powerful and flexible implementation. I can imagine a lot of things that are possible to do in a session beyond what the standard implementation provides. There are several scenarios where the pattern does not meet well. Although most scenarios dispense with any other solution.
In addition to obviously supplying more information, better integration with database and session distribution and transportation and otherwise identifying information and active session count are some examples of what can be improved.
As stated in the comments, the fact of creating a version of its own does not mean that it will get better. Although the intention of these frameworks is to facilitate the use of resources compared to what exists in PHP. Perhaps the attempt to do something better has left too complex.
Most of the problems I see with using the standard session have to do with misuse. Okay, it might be a little difficult to get it right, but it’s the programmer’s obligation to know how to do this. And the frameworks will have to choose between facilitating or giving a more powerful and flexible resource. What I see them doing a lot is applying such good practices, that is, they choose what is good for you, even if that is not the best ever.
By the size of documentation page of only one function gives you an idea of how difficult it is to use right, safely, but it doesn’t have much to do when the problem is complex (although it’s an exaggeration to call it complex).
I wonder if there is something bad with the standard PHP session engine?
If it was so problematic it would already have enough recommendation not to use, someone would have already made a replacement in PHP. It’s good to have some information here, but the problem isn’t in the resource, it’s in the little piece between the keyboard and the chair :)
I think people complain more about the CI session than PHP :D.
– rray
I can’t say categorically. I think it’s okay if you know how to use it. I believe that frameworks use in an easier way to do right and be an abstraction layer that allows to modify in the future the concrete implementation, besides giving some flexibilities and additional characteristics. That has limitation, has, has everything. Everything is limited to what it does. If you need more, it’s another matter.
– Maniero
Of course, the IC people give two options: Database and Cookie. Using cookie as session is a very half-hearted option. Then it is better to give a session_start in the middle of a code that should not use it
– Wallace Maxters
@interesting mustache. You answered something similar to gmsantos in this question http://answall.com/questions/73058/por-que-deveriausar-filecopy-se-no-php-j%C3%A1-existe-copy
– Wallace Maxters
Apparently it generates race conditions in the case of lavarel: https://github.com/laravel/framework/issues/5416#issuecomment-68366445. I remember having already faced similar problems with php Native Session in the in-house framework that I keep at work, but for some time and do not remember exactly what it was and how we solved, only it was boring.
– BrunoRB
It is not bad to use the PHP session, what makes it bad is the way some programmers use it.
– Miguel Batista