Re: Something I am doing with Session seems funky

From: Stephanie Stowe (stowe_at_whackthisvsac.org)
Date: 04/07/04


Date: Wed, 7 Apr 2004 10:53:27 -0400

Never thee mind.... I figured it out. I had a session.abandon. DOH. After
the Session.Abandon, Session_OnStart was firing. Geeesh.

Sorry to waste time.

S
"Stephanie Stowe" <stowe@whackthisvsac.org> wrote in message
news:ehkHPHKHEHA.2924@TK2MSFTNGP09.phx.gbl...
> I am reading some data from a database and placing the values into session
> variables. See code:
>
> dim lngSessionID, pStr
>
> pStr = "private, no-cache, must-revalidate"
> Response.ExpiresAbsolute = #2000-01-01#
> Response.AddHeader "pragma", "no-cache"
> Response.AddHeader "cache-control", pStr
>
>
>
> ' Get the return cookie. If the return cookie is set, then coming BACK.
> If Request.Cookies("JSPAccessed") = "Yes" then <-- This is evaluated
as
> true. (I did not include the other subs as they are not executed and not
> part of the problem.
> DoReturn
> else
> WriteSessionInfo
> WriteIdentifierCookie
> end if
>
>
>
> Sub DoReturn
>
>
> dim strSQL, rs, strSessionID, strLoadPage, sessitem
>
>
> strSessionID = Request.Cookies("MyID")
>
>
> Response.Cookies("JSPAccess").Expires = #2000-01-01#
>
>
> ' Get the service to return to.
> strSQL = "select M.ASPSessionID, S.LoadPage FROM Stowe.SessionMgr As M
> INNER JOIN Stowe.SessionSources As S ON M.SourceService = S.SourceName " &
_
> "WHERE M.SessionID = " & strsessionid
>
> set rs = cn.execute(strSQL)
> strLoadPage = "../" & trim(rs("LoadPage").value)
>
>
> if rs("ASPSessionID").value <> session.SessionID then
> Session.abandon ' "delete" stuff which was initialized in
Session_OnStart
> strsql = "Select * FROM Stowe.SessionDetail Where SessionID=" &
> strSessionID
> set rs = cn.execute(strSQL)
> do while not rs.eof
>
>
> Session(rs("VarName").value) = rs("VarValue").value
> rs.movenext
> loop
>
>
> for each sessitem in Session.Contents
> Response.Write sessitem & " - " & session.Contents(sessitem) & "<BR>"
> next
> Response.End
>
>
> end if
>
>
> rs.close
> set rs = nothing
>
>
>
>
> Response.Redirect strLoadPage
>
> End Sub
>
>
>
> ---------------------------------
>
> In this segment,
>
> for each sessitem in Session.Contents
> Response.Write sessitem & " - " & session.Contents(sessitem) & "<BR>"
> next
> Response.End
>
> I am writing the contents of the session for testing so I can see what is
in
> it. I am seeing each item twice with different values. I am trying to
> understand why. I see:
>
> AUTH - True
> ROLE - Borr
> SchoolID - 0
> SchoolName -
> Attempts - 1
> UserID - 0
> EFC_Year - 2001
> EFCTest - False
> PersonID - xxx
> SSN - xxx
> UserType - N
> AUTH - True
> ROLE - Borr
> SchoolID - 0
> SchoolName -
> Attempts - 1
> UserID - 0
> EFC_Year - 2001
> EFCTest - False
> PersonID - xxx
> SSN - xxx
> UserType - N
>
>
> Why am I seeing the set of session vars writing to the browser twice? I
can
> see in the database from whcih the values are retrieved that there are 11
> and they match a single set from AUTH through UserType.
>
> I would like to understand this so I am not messing up my session.
>
> Please note that there is not a single other response.write in the rest of
> the code. For what that is worth...
>
> Thanks
>
> S
>
>



Relevant Pages

  • Problems with Forms Auth and Session State.
    ... Clearly Forms Authentication manages it's Authorization state using a ... different cookie than the Session cookie. ... using Forms auth to auth the user and set the Auth cookie. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: php vs. apache login verification security?
    ... This would make it easier to maintain the auth and other global routines ... > into the cookie to allow for session identification. ... The hashing of username and password is -only- to prevent ...
    (alt.php)
  • FormsAuth and Sessions Troubles...
    ... I'm having some trouble implementing Forms Authentication and using ... I can keep my Auth Cookie, and Session timed in sync and i have ... Dim roles As String ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Windows Update on Server 2000 through Terminal Services
    ... > Details from WindowsUpdate.log for failed item (TS Session): ... S-1-5-18 is the SID for the System Account. ... > services I get 0x8024401B error for all downloads it attempts (the scan ... > proxy auth or server auth. ...
    (microsoft.public.windowsupdate)