title: Cookies are not send with the request in Safari on iPhone and iPad
body: <p>I am struggling with one issue for past few days. For my web application, cookies are used to recognize the machine. If proper cookies are not passed with the request, then the application will go through the second factor authentication(ie user has to enter OTP to login).</p>
  
  <p>Only on iPhone and iPad, users are being asked to enter the OTP every times. I can see that cookies are created on iPhone/iPad, but it is not being send to server with the subsequent requests. This behavior is only if we closes and re-open the safari browser. If I did not close Safari, then cookies are being passed without any issues and application is working as expected.</p>
  
  <p>We do not have this issue in Android/MacOS/Windows OS.</p>
  
  <p>If any one have any idea, please help me.</p>
  
  <p>NOTE: We are using secure HttpOnly persistent cookies. The expiration of the cookie is one year.</p>
  
  <p>Cookie creation code is as follows</p>
  
  <pre><code>    private void CreateCookie(HttpResponseBase aobjResponse, string astrCookieKey, string astrCookieValue, DateTime adtCookieExpiry)
      {
          HttpCookie lobjCookie = new HttpCookie(astrCookieKey)
          {
              Expires = adtCookieExpiry,
              Value = astrCookieValue,
              HttpOnly = true,
          };
  
          if (aobjResponse.Cookies.Get(astrCookieKey) != null)
          {
              aobjResponse.Cookies.Remove(astrCookieKey);
          }
  
          aobjResponse.Cookies.Add(lobjCookie);
      }
  </code></pre>