Home » Php » php – why my host add automaticlly add secure flag to cookie?

php – why my host add automaticlly add secure flag to cookie?

Posted by: admin February 25, 2020 Leave a comment

Questions:

I wrote a program that set a cookie. it work well in http mode, but when I use https protocol, header of cookie add automatically add secure flag to it.

set-cookie: val=is; expires=Sun, 16-Feb-2025 07:26:50 GMT; Max-Age=90000; path=/; secure

my code is:

<?php
header('Set-Cookie: val=is; expires=Sun, 16-Feb-2025 07:26:50 GMT; Max-Age=90000; path=/');

What makes this happen?

How to&Answers: