Session state / shopping cart issue

A

anony

Hi,

I'm building a shop site where the cart is stored in the session state. I'm
having a problem with a particular page that processes a code which adds
products to the cart at a discount. I have an unhandled exception that
results from the session expiring before processing the code. It goes
something like this:

1) Enter code.
2) Code is validated. Products are added to a datatable in session state.
Products / discounts are shown to user and user is prompted to process code.
3) User processes code. If session is alive, all is well and products are
added to cart. If the session expires after the user enters the code but
prior to processing code, my datatable listed above is no longer available
and thus my problem presents itself.

I'm looking for suggestions on how I should (better) implement the above. I
suppose I could put the product table into the page's viewstate? More
elegantly, I would like to check to see if a new session was created during
step 3 above.

Thanks for any help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top