You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Sessions, the Auth and general Data are shared across all tabs in an open browser; so if you login to a site on one tab with a view counter, and then open a new tab, you'll be immediately logged in and the view counter would show the same value as the previous tab.
This extension to Sessions will make it so that the Auth data is still shared across all tabs, but the general data (like view counters, etc.) will be split across the different tabs. In the above example, both tabs would show different view counter values.
This enhancement is dependant on client-side logic, and use of a browser's sessionStorage, so Auth data has to be shared.
This could be done by adding a new -Scope parameter to Enable-PodeSessionMiddleware with possible values of Browser and Tab - with Browser being the default. When using -Scope Tab the "Session Tab ID" will be sourced from an X-PODE-SESSION-TAB-ID, and will be used to "extend" the main cookie/header SessionId.
If any Tab is ever "logged out" of, the base session with Auth data will be revoked, which will revoke all Tab sessions as well.
Documentation
For the documentation around Tab Sessions, ensure to mention that client-side logic is required - this feature doens't just work when enabled. Also, flag that using sessionStorage isn't exactly the best, and could be fetched/manipulated by 3rd parties - XSS. Enabling this is entirely the user's choice.
Describe the Change
When using Sessions, the Auth and general Data are shared across all tabs in an open browser; so if you login to a site on one tab with a view counter, and then open a new tab, you'll be immediately logged in and the view counter would show the same value as the previous tab.
This extension to Sessions will make it so that the Auth data is still shared across all tabs, but the general data (like view counters, etc.) will be split across the different tabs. In the above example, both tabs would show different view counter values.
This could be done by adding a new
-Scope
parameter toEnable-PodeSessionMiddleware
with possible values ofBrowser
andTab
- withBrowser
being the default. When using-Scope Tab
the "Session Tab ID" will be sourced from anX-PODE-SESSION-TAB-ID
, and will be used to "extend" the main cookie/header SessionId.If any Tab is ever "logged out" of, the base session with Auth data will be revoked, which will revoke all Tab sessions as well.
Documentation
For the documentation around Tab Sessions, ensure to mention that client-side logic is required - this feature doens't just work when enabled. Also, flag that using sessionStorage isn't exactly the best, and could be fetched/manipulated by 3rd parties - XSS. Enabling this is entirely the user's choice.
Related Issues
Badgerati/Pode.Web#406
The text was updated successfully, but these errors were encountered: