Feb 25, 2016
0
Level 4
Setting my own Session Keys in Laravel
Edit: Nevermind
I want to extend the Session manager of Laravel so I wrote in a ServiceProvider:
Session::extend('custom-session', function () {
return new CustomSessionHandler();
});
However, I want to be able to generate my own Session tokens/keys/ids as well, rather than have Laravel build them. This seems to be from the \Illuminate\Session\Store class, in the generateSessionId() function.
protected function generateSessionId()
{
return sha1(uniqid('', true).Str::random(25).microtime(true));
}
Is there a way I can build my own Store class that extends this one and override this method? Or is there a better way of doing it?
Many thanks
Please or to participate in this conversation.