Results 1 to 1 of 1

Thread: Session Swapping

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    90

    Session Swapping

    I have an issue where I have an ASP.Net app that uses a Session varible to track who is logged in, is some how swapping the object that is in the varible with a different one in memory. At least that is what the evendence is showing right now. Here is the steps and the code

    First, when a user logs in, we set an object into a Session Varible
    VB Code:
    1. Dim oSocialWorker As SocialWorker = oUserDB.Login(cmbUser.Text.Trim.ToString, txtPassword.Text.Trim.ToString)
    2. Session("SocialWorker") = oSocialWorker
    oUserDB.Login is returning a class with the properties set for a user.

    This part works, because the next page (Referrals.aspx) uses the object in the Page_Load without issue. That code is below.
    VB Code:
    1. If Not IsPostBack Then            
    2. Dim oSocialWorker As SocialWorker = Session("SocialWorker")
    3. lblSocialWorkerInfo.Text = "Referrals for " & oSocialWorker.LastName & ", " _
    4. & oSocialWorker.FirstName & " in the " & oSocialWorker.LC_Name
    The lblSocialWorkerInfo is loaded correctly

    Then the user clicks on a button to go to another page. The code behind the botton is below.
    VB Code:
    1. Response.Redirect(Request.ApplicationPath + "/Interventions.aspx", True)
    Then, the user clicks on an another link to go back to the first page
    VB Code:
    1. Response.Redirect(Request.ApplicationPath + "/Referrals.aspx", True)
    Now when this code executes again,
    VB Code:
    1. Dim oSocialWorker As SocialWorker = Session("SocialWorker")
    2. lblSocialWorkerInfo.Text = "Referrals for " & oSocialWorker.LastName & ", " _
    3. & oSocialWorker.FirstName & " in the " & oSocialWorker.LC_Name
    The lblSocialWorkerInto label now has a different persons name.

    We have tried and tried to recreate this on our development server and can not.

    Also, we are using "Cookieless=false" setup.

    Any ideas???

    Thanks
    Last edited by jstansell; Sep 14th, 2005 at 06:09 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width