Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET - Accessing web page twice from client
    primarykey
    data
    text
    <p>What happens if one user tries to access an ASP.NET page twice before the first page is returned to the client? Have a look at the code below:</p> <pre><code>Partial Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Session("ID") = 1 End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Response.Redirect("Default3.aspx") End Sub End Class Partial Class Default2 Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Session("ID") = 2 End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Response.Redirect("Default3.aspx") End Sub End Class Imports System.Threading Partial Class Default3 Inherits System.Web.UI.Page Dim intTest As Integer = 0 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load For intTest = 0 To 10 Response.Write(Session("ID") &amp; " " &amp; intTest &amp; "&lt;br&gt;") Thread.Sleep(1000) Next End Sub End Class </code></pre> <p>Accessing default3.axpx from the same client (PC) concurrently from default.aspx (by clicking button) and default2.aspx (by clicking button) causes the session variable to be the same on both requests (though I set the variable to 1 on the first request and 2 on the second). Is it possible to replicate this behaviour without threading? I believe I have this bug in an asp.net application that does not use threading.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload