<%@ Page Language="C#" %>

<% 
    
    if (Request.Cookies["siteLanguage"] != null) Request.Cookies.Remove("siteLanguage"); 
    
    HttpCookie lang = new HttpCookie("siteLanguage", Request["lang"]);
    lang.Expires = DateTime.Now.AddDays(30);
    Response.Cookies.Add(lang);

    Response.Cache.SetCacheability(HttpCacheability.NoCache);
    Response.Cache.SetExpires(DateTime.Now.AddMinutes(-30));

    if (Request.UrlReferrer != null)
    {
        Response.Redirect(Request.UrlReferrer.AbsolutePath);
    }
    else
    {
        Response.Redirect("~/");
    }
    
    %>