473,378 Members | 1,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Session_End Event Always Firing

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

Dec 3 '05 #1
1 1610
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.

"Jeremy" <sl********@hotmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
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

Dec 3 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris Sibel | last post by:
Hey guys I have a user tracking setup to track users. What it does is once a user hits my site it sends me an email telling me some info and once a user clicks the logout button it sends a second...
9
by: Kenn Ghannon | last post by:
I've got an ASP.NET page with a counter subtraction routine in the Session_End method in the Global.asax.cs: protected void Session_End(Object sender, EventArgs e) { ulong curUsers; ...
5
by: Steve M | last post by:
Why are my sessions lasting so long? I have them set to 20 minute timeout in config file? The Session_End event is getting called an hour or more sometimes--well after the user has stopped...
2
by: Bela | last post by:
Hello I was wondering if someone could help me out with a Session_End problem in my Global.asax. I've tried everything, and still no success Here is the scenario: sessionstate is set to InProc....
5
by: JezB | last post by:
Why is my Session_End event in global.asax never firing ? I've tried fiddling with the timeouts but still nothing. Ideally I want to do some processing whenever someone leaves my web application...
11
by: OldProgrammer | last post by:
All the documentation and discussion I have read indicate that the Session_End is not supposed to fire unless you are in "inProc" Session state mode, and then only on Session Timeout or at Session...
2
by: James Hunter Ross | last post by:
Friends, In our Global.asax file we implement Session_End() which grabs our own object and then calls our own logout() method to tidy things up. Code is below. (We wrap this in try/catch, but...
7
by: Bruno | last post by:
We are attempting to automatically log users off from the Session_End event in global.asax and set some values on session_start. It is not a critical task, more of a housekeeping task so that we...
8
by: Roger | last post by:
When I call the session.abandon() method, it calls the session_end event. When a user closes the browser or clicks the log off button, I can dispose of objects and abandon the session cleaning....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.