Session_End Event Always Firing

  • Thread starter Thread starter Jeremy
  • Start date Start date
J

Jeremy

I am implementing a shopping cart on a project and am getting extremely
frustrated because my session variable's are not persisting. After
doing some research I may have discovered the source, I realized that
my session_end event is firing on almost every page. The session_end
event isn't supposed to fire on every page is it? If not, what are some
things I can do to stop this behavior? Thanks in advance for your
input!

Code Below:

Function makeCart()
'Shopping Cart
Dim objDT As System.Data.DataTable

objDT = New System.Data.DataTable("Cart")
objDT.Columns.Add("ID", GetType(Integer))
objDT.Columns("ID").AutoIncrement = True
objDT.Columns("ID").AutoIncrementSeed = 1

objDT.Columns.Add("Quantity", GetType(Integer))
objDT.Columns.Add("Product", GetType(String))
objDT.Columns.Add("Cost", GetType(Decimal))

Session("Cart") = objDT

End Function

- Jeremy
 
Hi Jeremy,

The only code you posted is a function called "makeCart()." It isn't in any
context, and there's nothing in it that would cause a Session to end. There
must be something else that is common to all pages in your app which is
causing the Session to end.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.
 
Back
Top