Skip to content
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

How to add extra data on session guard recaller #42271

Closed
PaolaRuby opened this issue May 5, 2022 Discussed in #42067 · 6 comments · Fixed by #42316
Closed

How to add extra data on session guard recaller #42271

PaolaRuby opened this issue May 5, 2022 Discussed in #42067 · 6 comments · Fixed by #42316

Comments

@PaolaRuby
Copy link
Contributor

PaolaRuby commented May 5, 2022

Discussed in #42067

Originally posted by PaolaRuby April 20, 2022
Only admit 3 segments, id,token,hash

protected function hasAllSegments()
{
$segments = explode('|', $this->recaller);
return count($segments) === 3 && trim($segments[0]) !== '' && trim($segments[1]) !== '';
}

Is there a config for set a custom recaller with more segments?
Is there a way or a plugin for customize session recaller?

If we create a custom session class extending SessionGuard, or we change the remember me cookie on login, we need a way to get the extra data from recaller
This is useful when you have a multi company login, or when needs an extra id/value to rebuild the session

@PaolaRuby
Copy link
Contributor Author

Let's be honest, @taylorotwell only reviews PR from known collaborators, he closes everyone else without reviewing with the same copy/paste message

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

@driesvints
Copy link
Member

Hey @PaolaRuby, please don't move discussions to issues.

Also, Taylor is free to merge whatever he prefers into the codebase. I'm sorry you feel differently.

@PaolaRuby
Copy link
Contributor Author

PaolaRuby commented May 5, 2022

@driesvints thanks for answer

Taylor is free to merge whatever he prefers into the codebase

It's ok, but there is no info for this, and no option for make it possible, i am questioning on every place i know without answer, here is my last option
Could you look what was wrong with #42262, or there is a better option? Please 🙏 Please

@taylorotwell
Copy link
Member

How are you setting these custom segments? Why do you need them at all? Why not store them in a database table associated with the user?

@taylorotwell
Copy link
Member

Also, Laravel has over 2,000 contributors - so, no, they are not all my "known collaborators".

@PaolaRuby
Copy link
Contributor Author

PaolaRuby commented May 5, 2022

Multi company login, company is a manyToMany relation with user, on login user pick wich company use for session, on "remember me" laravel rebuild the user session but not the company, of course i can create another cookie for rebuild the picked company, but would be great if the recaller can handle that extra id/ids

@taylorotwell thank, first time you answer me

Also, Laravel has over 2,000 contributors - so, no, they are not all my "known collaborators".

Sorry ,I don't know how to solve it

#42262 keeps same functionality, but adds option for more segments, really small not breaking change


How are you setting these custom segments?

Login or custom session guard

Why do you need them at all?

Rebuild the picked login company on session with remember me(recaller)

Why not store them in a database table associated with the user?

User can be logged on two or more companies at the same time(using different browsers, or with incognito mode)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants