Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This solution works great. I translated the code to vb if anyone wants it:</p> <pre class="lang-vb prettyprint-override"><code> Protected Sub Application_BeginRequest(ByVal sender As Object, ByVal e As System.EventArgs) 'we guess at this point session is not already retrieved by application so we recreate cookie with the session id... Try Dim session_param_name = "ASPSESSID" Dim session_cookie_name = "ASP.NET_SessionId" If Not HttpContext.Current.Request.Form(session_param_name) Is Nothing Then UpdateCookie(session_cookie_name, HttpContext.Current.Request.Form(session_param_name)) ElseIf Not HttpContext.Current.Request.QueryString(session_param_name) Is Nothing Then UpdateCookie(session_cookie_name, HttpContext.Current.Request.QueryString(session_param_name)) End If Catch ex As Exception End Try Try Dim auth_param_name = "AUTHID" Dim auth_cookie_name = FormsAuthentication.FormsCookieName If Not HttpContext.Current.Request.Form(auth_param_name) Is Nothing Then UpdateCookie(auth_cookie_name, HttpContext.Current.Request.Form(auth_param_name)) ElseIf Not HttpContext.Current.Request.QueryString(auth_param_name) Is Nothing Then UpdateCookie(auth_cookie_name, HttpContext.Current.Request.QueryString(auth_param_name)) End If catch ex As Exception End Try End Sub Private Sub UpdateCookie(ByVal cookie_name As String, ByVal cookie_value As String) Dim cookie = HttpContext.Current.Request.Cookies.Get(cookie_name) If cookie Is Nothing Then cookie = New HttpCookie(cookie_name) End If cookie.Value = cookie_value HttpContext.Current.Request.Cookies.Set(cookie) End Sub </code></pre> <p>Here's the part for the javascript variable assignment:</p> <pre class="lang-js prettyprint-override"><code>var auth = "&lt;%=IIf(Request.Cookies(FormsAuthentication.FormsCookieName) Is Nothing, "", Request.Cookies(FormsAuthentication.FormsCookieName).Value)%&gt;"; var ASPSESSID = "&lt;%=Session.SessionID%&gt;"; </code></pre> <p>Maybe someone working in VB can benefit from that.</p>
    singulars
    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.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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