Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ios 11.4 cookies
Is there a reason why this code to set cookies does not work in Safari on ios 11.4?

The code has been in production for some time running Intraweb ultimate 14.2.7 with SSL but recent reports suggest it no longer works for iPhone users. Does anyone here have insight or experience with this?

function GetCookieValue(sName: String): String;
  Result := WebApplication.Request.CookieFields.Values[sName];

procedure SetCookie(CookieName, CookieValue: String; ExpireIn: Real);

  ExpireOn: Real;
  if ExpireIn <> 0 then
    ExpireOn := GetUTCDateTime + ExpireIn
    ExpireOn := -1; // session cookie
  WebApplication.Response.Cookies.Add(THTTPCookie.Create(CookieName, CookieValue, '/', ExpireOn));
Maybe Apple decided that they need an iCookie now, and plain cookies won't work anymore... who knows? :-)

Please give a try with this code instead:


BTW, you shouldn't calculate UTC time yourself. Different applications tread this differently (i.e. SA Indy, ISAPI, etc.). Is not guaranteed that your code will handle them all correctly. IW will convert when necessary. You just need to provide a DateTime value according to your server time.

Also, Apple has been changing cookie policy since iOS 11 release, restricting its usage. Are you sure that cookies are enabled on this specific device?

Forum Jump:

Users browsing this thread: 1 Guest(s)