Drupal will set the Secure attribute on session cookies when the site is being accessed via https. Therefore, if the site is being accessed via https session cookies will typically have both the HttpOnly and Secure attribute set.
How do I enable cookies in Drupal 8?
With Drupal 7, Drupal 8, and Drupal 9 you can use user_cookie_save() to store a cookie. The first function parameter is an array. Its keys are the names of the cookies to set; its values are the values to set for those cookies.
Is Drupal being discontinued?
In November 2021, after over a decade, Drupal 7 will reach end of life (EOL). (More information on why this date was chosen.) Official community support for version 7 will end, along with support provided by the Drupal Association on Drupal.org. ... Drupal 7 will no longer be supported by the community at large.