Search code examples
asp.netsharepointsharepoint-2010session-statemicrosoft-commerce-server

Where to put code that loads products from cookie?


We have a project which is Sharepoint solution combined with Commerce Server. It's a webshop, and we are currently installing a feature where the products but in the basket is stored using cookies.

We are doing that by adding all the products guids + quantity in a cookie file.

However, where to load the users basket on their next visit?

On a normal asp.net website I would use Global.asax -> Session_start, but as far as I can tell, there are no Global.asax in a Sharepoint solution.

So my question is: Is there any way to react on the session_start event in Sharepoint? Or are there other events/ways which are more appropriate? I am not really much into Sharepoint, so any help is gladly accepted!


Solution

  • We ended up putting the code in the webpart for the shopping basket. This is a pretty good solution as it exists on every page on the website.

    I would prefer putting the code in a HttpModule, but setting that up in Sharepoint is pretty annoying.. Also it is more error prune than just putting the code in the shopping basket.