Title: Optional secure cookie flag
Last modified: February 24, 2017

---

# Optional secure cookie flag

 *  [kkretsch](https://wordpress.org/support/users/kkretsch/)
 * (@kkretsch)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/optional-secure-cookie-flag/)
 * On a https only website the plugin should be able to add the “secure” flag to
   the new created cookie. I added that attribute hardcoded for one of my sites 
   and it seems to work.
 * /wp-content/plugins/wp-cookiechoise/js/cookiechoices.js Line 158:
 * document.cookie = cookieName + ‘=y; secure; expires=’ + expiryDate.toGMTString()
   + “;domain=” + document.domain + “;path=/”;

The topic ‘Optional secure cookie flag’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-cookiechoise_f0e5d8.svg)
 * [Wp Cookie Choice](https://wordpress.org/plugins/wp-cookiechoise/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-cookiechoise/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-cookiechoise/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-cookiechoise/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-cookiechoise/reviews/)

## Tags

 * [HTTPS](https://wordpress.org/support/topic-tag/https/)

 * 0 replies
 * 1 participant
 * Last reply from: [kkretsch](https://wordpress.org/support/users/kkretsch/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/optional-secure-cookie-flag/)
 * Status: not resolved