PDA

Click to See Complete Forum and Search --> : Session Swapping


jstansell
Sep 14th, 2005, 06:05 PM
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
Dim oSocialWorker As SocialWorker = oUserDB.Login(cmbUser.Text.Trim.ToString, txtPassword.Text.Trim.ToString)
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.
If Not IsPostBack Then
Dim oSocialWorker As SocialWorker = Session("SocialWorker")
lblSocialWorkerInfo.Text = "Referrals for " & oSocialWorker.LastName & ", " _
& 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.
Response.Redirect(Request.ApplicationPath + "/Interventions.aspx", True)
Then, the user clicks on an another link to go back to the first page
Response.Redirect(Request.ApplicationPath + "/Referrals.aspx", True)
Now when this code executes again,
Dim oSocialWorker As SocialWorker = Session("SocialWorker")
lblSocialWorkerInfo.Text = "Referrals for " & oSocialWorker.LastName & ", " _
& 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