public ActionResult SignIn() { var isLogged = _sessionContext.CurrentUser != null && System.Web.HttpContext.Current.Request.IsAuthenticated; ViewBag.isB2BEnable = _sessionContext.CurrentSiteConfig.B2BSettings.EnableB2B; ViewBag.isRegistrationAllowed = _sessionContext.CurrentSiteConfig.B2BSettings.RegistrationAllowed; _basketApi.ResetSessionBasket(); if (isLogged) { return(Redirect("~")); } string returnUrl = string.Empty; //So that the user can be referred back to where they were when they click logon if (Request.UrlReferrer != null) { returnUrl = Server.UrlEncode(Request.UrlReferrer.PathAndQuery); } //if (Url.IsLocalUrl(returnUrl) && !string.IsNullOrEmpty(returnUrl)) if (!string.IsNullOrEmpty(returnUrl)) { TempData["ReturnURL"] = returnUrl; } var userModel = new UserModel { isLogin = true }; return(View(CustomViews.SIGN_IN, userModel)); }