Note that there are some explanatory texts on larger screens.

plurals
  1. POSessionID not retaining same value through a session
    text
    copied!<p>I have a strnge problem which I dont know how to resolve.</p> <p>The sessionID keeps changing every time I open a page in the application. But when I debug the program, the sessionID remains constant and does not change</p> <p>The application is installed on Windows server 2008 R2 (iis 7.5 and dotnet framework 4.0)</p> <p><code>&lt;sessionState cookieless="UseCookies" mode="InProc" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" stateConnectionString="tcpip=127.0.0.1:42424" timeout="60" /&gt;</code></p> <p>What is the matter?</p> <p>Note: This works fine on my local development machine.</p> <p><strong>EDIT</strong></p> <p>This is the code in Global.asax.vb for Session_Start`</p> <pre><code> Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) Session("mySessions") = "junk" AddMySessions() If User.Identity.IsAuthenticated Then Dim cmd As New SqlCommand Dim sql As String sql = String.Format("SELECT EmpID FROM Intranet_Employees WHERE Username='{0}'", sUserName) cmd.CommandText = sql ' Production ... Session("EmpID") = CType(Dao.ExecuteScalar(cmd, ConfigurationSettings.AppSettings("cSqlTemplateDB")), String) Dim oEmpInfo As New TOrders.Data.Objects.Employee(Convert.ToInt64(Session("EmpID"))) Session("EmpInfo") = oEmpInfo If Application("SessionCount") Is Nothing Then Application.Lock() Application("SessionCount") = 0 Application.UnLock() End If Application.Lock() Application("SessionCount") += 1 Application.UnLock() Else Response.Redirect("http://intranet/tsystem") End If End Sub Private Sub AddMySessions() Dim sMsg As String = Session.SessionID &amp; ";" &amp; Now.ToString &amp; ";" &amp; Request.ServerVariables.Get("AUTH_USER").ToString If IsNothing(Application("mySessions")) Then Dim arrSessions As New ArrayList arrSessions.Add(sMsg) Application.UnLock() Application("mySessions") = arrSessions Application.Lock() arrSessions = Nothing Else Dim arrTemp As ArrayList = CType(Application("mySessions"), ArrayList) arrTemp.Add(sMsg) Application.UnLock() Application("mySessions") = arrTemp Application.Lock() arrTemp = Nothing End If sMsg = Nothing End Sub </code></pre> <p>`</p>
 

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