-
-
Notifications
You must be signed in to change notification settings - Fork 932
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
Share session data across mounted routes #1351
Conversation
This looks like a great solution... also, I now learned how to test the session cookie. |
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Answering your comment above: in terms of styling, either the current or using the attribute you previously had, it's fine by me.
I would've used session_path
as there's no concept of "session_root_path" yet, so we can choose the name. But whatever you prefer is fine. :)
Did you delete your comment? 🤔 |
@Kludex Yes 😅 I thought about an even more specific name, pushed it in a commit. Also I think we should use the attribute style, at least check on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! :)
@florimondmanca Is there something else you'd want to check here? |
I think this is an okay change — as in, it does solve the use case. But the "special case" flavor of it still makes me think I'd like @tomchristie's opinion. Tom? 😄 |
Any updates? |
Thanks @florimondmanca! Going to close this off in favour of #1512. |
Fixes #1261
The resolution here builds on @devsetgo's idea:
Indeed, if we
Mount(routes=...)
, theroutes
actually belong to the current app in the mount hierarchy, not to a fully separate app mounted on the sub-path, so session data on the current app should be shared with them.Note that we otherwise keep the "use root_path for (fully) sub-mounted apps" for #233.