We have the implement the following scenario in our application:
- We use windows authentication. User opens our website in tab1 and does some action but with out clicking on save he opens a new tab tab2 and opens the same website again.
- Now, if the user session in tab1 is active i need to warn users that the he is already logged on to application in some other browser and go to some log out page. But if the user session in tab1 is timed out then he must be able to continue with the website in tab2 as usual, but if he tries to do anything in tab1 he should go to session expired page.
I tried implementing it in following way.
- I have a hidden field in each page which will be set to unique Id using GUID.NewID().
- when user requests for a page the following code is executed.
if (Request.Headers["Cookie"] == null)
//this means user is requesting hte page for first time.
//Generate a new GUID store it in session and also in the hidden variable on page.
Session["DefaultPage"] = Guid.NewGuid().ToString();
((TextBox)page.FindControl("hiddenGUID")).Text = Session["DefaultPage"].ToString();
else if (Reque
View Complete Post