Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET MVC 4 Cookie is not saved on Azure but locally its saves
    primarykey
    data
    text
    <p>I have an ASP.NET MVC 4 Project that I call using javascript. I'm about ready to pull my hair out as I just can't figure out why this is not working on the Azure server but locally its working like a charm. I have the following action:</p> <pre><code>public HttpStatusCodeResult Index() { //Save the Cookie CookieUtil.CreateCookie("CookieName", "completeCookieContent", CookieExpiration); //cookie expiration is dynamically calculated in another function to be 30 days later Response.AddHeader("x-frame-options", "DENY"); Response.StatusCode = (int)HttpStatusCode.NoContent; Response.Cache.SetLastModified(DateTime.Now); Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache); Response.Expires = -1500; Response.Cache.SetNoStore(); Response.ExpiresAbsolute = DateTime.Now.AddYears(-1); return new HttpStatusCodeResult(HttpStatusCode.NoContent, "No Content"); } </code></pre> <p>My <code>CreateCookie</code> Helper is as follows:</p> <pre><code>public static void CreateCookie(string cookieName, string value, int? expirationDays) { HttpCookie Cookie = new HttpCookie(cookieName, value); if (expirationDays.HasValue) Cookie.Expires = DateTime.Now.AddDays(expirationDays.Value); HttpContext.Current.Response.Cookies.Add(Cookie); } </code></pre> <p>I'm calling this page remotely via Jquery Load function from another website (crossDomain) (maybe this is the problem)</p> <p>Locally, if I've tested this using a simple html page that uses the same load function and everything works and the cookie gets created under localhost. As soon as I upload this code on azure (websites), I get the call and it returns the 204 no content. But the Cookie does not get dropped under my domain. What </p> <p>could be the problem? Am I missing a fundamental that doesn't allow this action? how can I overcome this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload