Ejemplo n.º 1
0
        public static void SetCookies(HttpRequest request, HttpResponse response)
        {
            int clientID = Convert.ToInt32(request.QueryString["clientID"]);

            if (clientID == 0)
            {
                string url = request.Url.ToString();
                url = url.Remove(url.LastIndexOf("/")).Replace("/v2", "");

                com.dailyez.Service service = new com.dailyez.Service();

                clientID = service.GetClientIDFromUserFriendlyURL(ConfigurationManager.AppSettings["webServiceKey"], url);

            }

            int index = Convert.ToInt32(request.QueryString["index"]);
            int euID = Convert.ToInt32(request.QueryString["euID"]);
            string browserType = request.QueryString["browserType"];
            int id1 = Convert.ToInt32(request.QueryString["id1"]);
            int id2 = Convert.ToInt32(request.QueryString["id2"]);
            int tab = Convert.ToInt32(request.QueryString["tab"]);
            if (clientID > 0)
                SaveCookie(response, request, "clientID", "" + clientID);

            if (index > 0)
                SaveCookie(response, request, "index", "" + index);

            if (euID > 0)
                SaveCookie(response, request, "euID", "" + euID);
            if (browserType != null)
                SaveCookie(response, request, "browserType", "" + browserType);

            if (id1 > 0)
                SaveCookie(response, request, "id1", "" + id1);

            if (id2 > 0)
                SaveCookie(response, request, "id2", "" + id2);
            if (tab > 0)
                SaveCookie(response, request, "tab", "" + tab);
        }