M
msnews08
Hi,
We have an ASP.NET website that uses in process sessions to track some of
the user information stored across the web pages. 1 out of every 4 times we
see that the sessions getting mixed up resulting in malformed data and hence
the error. I’d like to share some data which was recorded on the production
server for a particular user for one session (please find below). Although we
use clustered environment, we do have a mechanism of sticky sessions tied up
to only one particular server which is done through network traffic
controllers. . To be more granular, we use serializable objects stored in a
session. Here is the snippet of code.
In BasePage.vb
Public ReadOnly Property OAUserSession() As UserSessionData
Get
If Session("UserSession") Is Nothing Then
_usd = New UserSessionData()
Session.Add("UserSession", _usd)
Else
_usd = CType(Session("UserSession"), UserSessionData)
End If
Return _usd
End Get
End Property
Page which stores the session
Me.OAUserSession.UserPurchaseContext.CurrentPackage = myPackage
OAUserSession, UserPurchaseContext and CurrentPackage are serializable
objects.
Page which retrieves the session
myPlaceOrder.CurrentPackage = OAUserSession.UserPurchaseContext.CurrentPackage
Every one of 4 times we have the session IDs getting mixed up. The
highlighted section below represents the values where the session values are
lost or mixed up.
Datetime Page Sequence Info
5/1/09 5:30 PM Before PriceId - 480, CustID - 36792, SessionID -
425nog45msby5xacp3ratm55
5/1/09 5:30 PM After CustID - 36792 , SessionID 425nog45msby5xacp3ratm55
5/1/09 5:31 PM Before PriceId - 480, CustID - 36792, SessionID -
g5nc0h55s3n4c0niypuvvs45
5/1/09 5:31 PM After Package - Empty Object , CustID - 36792 , SessionID
g5nc0h55s3n4c0niypuvvs45
5/1/09 5:35 PM After CustID - 36792 , SessionID buo2tyv2zq2nnzejuzyz3iig
5/1/09 5:35 PM Before PriceId - 480, CustID - 36792, SessionID -
buo2tyv2zq2nnzejuzyz3iig
5/1/09 5:38 PM Before PriceId - 480, CustID - 36792, SessionID -
buo2tyv2zq2nnzejuzyz3iig
5/1/09 5:38 PM After CustID - 36792 , SessionID buo2tyv2zq2nnzejuzyz3iig
5/1/09 5:39 PM Before PriceId - 480, CustID - 36792, SessionID -
bpplt345blweu345zakclcev
5/1/09 5:39 PM After Package - Empty Object , CustID - 36792 , SessionID
bpplt345blweu345zakclcev
Let us know if you need more information on this.
Thanks,
-Rajiv
We have an ASP.NET website that uses in process sessions to track some of
the user information stored across the web pages. 1 out of every 4 times we
see that the sessions getting mixed up resulting in malformed data and hence
the error. I’d like to share some data which was recorded on the production
server for a particular user for one session (please find below). Although we
use clustered environment, we do have a mechanism of sticky sessions tied up
to only one particular server which is done through network traffic
controllers. . To be more granular, we use serializable objects stored in a
session. Here is the snippet of code.
In BasePage.vb
Public ReadOnly Property OAUserSession() As UserSessionData
Get
If Session("UserSession") Is Nothing Then
_usd = New UserSessionData()
Session.Add("UserSession", _usd)
Else
_usd = CType(Session("UserSession"), UserSessionData)
End If
Return _usd
End Get
End Property
Page which stores the session
Me.OAUserSession.UserPurchaseContext.CurrentPackage = myPackage
OAUserSession, UserPurchaseContext and CurrentPackage are serializable
objects.
Page which retrieves the session
myPlaceOrder.CurrentPackage = OAUserSession.UserPurchaseContext.CurrentPackage
Every one of 4 times we have the session IDs getting mixed up. The
highlighted section below represents the values where the session values are
lost or mixed up.
Datetime Page Sequence Info
5/1/09 5:30 PM Before PriceId - 480, CustID - 36792, SessionID -
425nog45msby5xacp3ratm55
5/1/09 5:30 PM After CustID - 36792 , SessionID 425nog45msby5xacp3ratm55
5/1/09 5:31 PM Before PriceId - 480, CustID - 36792, SessionID -
g5nc0h55s3n4c0niypuvvs45
5/1/09 5:31 PM After Package - Empty Object , CustID - 36792 , SessionID
g5nc0h55s3n4c0niypuvvs45
5/1/09 5:35 PM After CustID - 36792 , SessionID buo2tyv2zq2nnzejuzyz3iig
5/1/09 5:35 PM Before PriceId - 480, CustID - 36792, SessionID -
buo2tyv2zq2nnzejuzyz3iig
5/1/09 5:38 PM Before PriceId - 480, CustID - 36792, SessionID -
buo2tyv2zq2nnzejuzyz3iig
5/1/09 5:38 PM After CustID - 36792 , SessionID buo2tyv2zq2nnzejuzyz3iig
5/1/09 5:39 PM Before PriceId - 480, CustID - 36792, SessionID -
bpplt345blweu345zakclcev
5/1/09 5:39 PM After Package - Empty Object , CustID - 36792 , SessionID
bpplt345blweu345zakclcev
Let us know if you need more information on this.
Thanks,
-Rajiv