-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Make session handlers implements SessionHandlerInterface
#57
Comments
@malukenho I suggest two separate repositories:
|
Note: relying on |
I'd oppose this proposal as long as you cannot prove that the resulting software will behave exactly identical compared to the classic files save handler, i.e. including locking and not losing any data on concurrent requests. If it behaves differently, it should not inherit from/extend a mechanism that people have certain expectations on how it works. |
@Ocramius relying on session directly or not is up to the user IMO. @SvenRtbg look at the interface: interface SessionHandlerInterface
{
/* Methods */
public bool close();
public bool destroy(string $session_id);
public bool gc(int $maxlifetime);
public bool open(string $save_path , string $name);
public string read(string $session_id);
public bool write(string $session_id, string $session_data);
} That's basically what we got now. My main point in here is that it should be the most simple to use we can, and the most important thing, should be most ease to get rid of it when you want. |
This is perfectly OK for apps that only need auth
Relying on a superglobal should be for legacy code, not for new code. |
@malukenho I known that interface. It's most overlooked requirement is that Various projects including Symfony and Laravel get this wrong, and it is constantly causing pain. Let's not add to this another bad implementation of See symfony/symfony#4976 or laravel/framework#7549 - there even is a dedicated wrapper-fix for Laravel: https://github.com/rairlie/laravel-locking-session |
@SvenRtbg I'm pretty sure locks without (shared) "storage" are impossible. |
@allflame Are you supporting this proposal, or is your statement against it? From my view, I don't see a benefit, and your comment underlined it:
If this is all true: Why implement What is the use case that should be supported here? Who would use that interface implementation, and in what kind of situation? |
@SvenRtbg honestly just wanted to share an opinion, as it's not up to me to decide. |
@SvenRtbg the limitations of this package are described in full in Other than that, writing both the session storage adapter and the legacy layer that provides the |
My proposal is to make
PSR7-Session
implements thephp
'sSessionHandlerInterface
. By doing that we can use$_SESSION
directly, or whatever other library that manage the session.Here's an exemple of what would be the set up for each handler:
You should be able to change the handler easy and with the bare minimum modification on your application.
Yes. I'm saying that we should get rid of the most of OOP user API, and May be write a separated session manage, or just leave the user to user whatever they want.
/cc @Ocramius @lcobucci
The text was updated successfully, but these errors were encountered: