Hi I will like to imitate the behaviour of the site ClickBank.com, for example:
Open the site, and login, if i open a tab with the same site, it ask me again to login.
It makes me wonder how to manage one session per tab.
Just to clarify, i don't loose control on the first tab if i log on in the new tab. They are separate sessions.
Thank you
The sessions are always shared trough all tabs. If two different Sessions are enough, you could use a privat/incognito browser window. A other solution could be to use HTML 5 SessionStorage for your variables.
Right, sessionStorage is not shared across tabs. The way I solved it is by using localStorage events. When a user opens a new tab, we first ask any other tab that is opened if he already have the sessionStorage for us.
call logout function. After login clear the Local Storage. While clicking login - > CLEAR_USER_SESSION - > Y - This will logout other session's of the same application in the same browser as per the below code. After login - change the value to N or empty - CLEAR_USER_SESSION - > 'Y' or ''.
Every browser tab uses the same Session for a single domain. State within a browser tab can be managed or tracked using the URL (HTTP GET) or a form field (HTTP POST).
Create a hidden field with a page ID and include that when you are trying to access whatever object in session Assign a random guid or value to that hidden control and then use it to store stuff in session
ex.
Session(PageID.Value & "CheckBoxes") = D
Hope that help!
asp.net - session - multiple browser tabs - different sessions?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With