Identify page request per tab(uniquely) which help server to interprit the request
as unique request for new tab even though it is for same record. In fact there are
many ways we can achieve this in Asp.NET.
First Solution. The Simpler Solution:
You can change config settings of Asp.NET site as following.
or
regenerateExpiredSessionId="true" />
As you show, the value “UseUri” of cookieless attribute with sessionstate tag is
set. This indicate to use cookieless session and in particular embed session
identifying code into the URI. So each tab you open contains unique code for
identifying the request as unique request in URI itself. The unique code is
appended before the page name.
i.e. http://www.abc.com/SampleWebSite/(S(afdg3ires1ik0lmjm3pkjtzl))/Home.aspx
The only cons of this solution is that the URI is then distorted with some unique
code. So user can not use it for bookmarking or promoting site. It is not
generating bookmark friendly.
Second Solution. Manually generate unique page identification code and insert it
into hidden field on every page.
In the form load include following code. It will generate unique page
identification code based on millisecond and other time component which always be
unique for your site.
If Not IsPostaback Then
'Generate a new PageiD'
Dim R As New Random(DateTime.Now.Millisecond +
DateTime.Now.Second * 1000 +
DateTime.Now.Minute * 60000 +
DateTime.Now.Minute * 3600000)
PageID.Value = R.Next()
End If
So by this method you can identify each tab request as unique requests. But it has
following two disadvantages.
First: The access of hidden element PageID is only when ViewState is restored on
postback. So you cannot access PageID in page_init().
Second: As hidden field is accessible to the visitor, anyone can change PageID. So
this solution will work only for environment with 100% trust ratio of all user.