protected void Session_Start() { // Remove abandoned sessions SessionManagement s = new SessionManagement(); s.RemoveExpiredSessions(); SessionHelper session = new SessionHelper(); if (Request.Cookies["ASP.NET_SessionId"] == null) { session.Initialize(); } else { session.UpdateSession(); } ShoppingCartRepo cartRepo = new ShoppingCartRepo(); cartRepo.SaveVisit(session.SessionID, session.Start); }