Set a cookie with the secure flag in PHP :-
Open php.ini file then search session.cookie_secure then replace this(;session.cookie_secure =) with session.cookie_secure = 1
Don’t forget to remember remove(;) in from of session.cookie_secure = 1
After that restart your server and check you found Secure flag
Note: If you not found secure flag then clear history or try on incognito mode
Output:-

Set a cookie with http only in PHP :-
Open php.ini file then search session.cookie_httponly then replace this(;session.cookie_httponly=) with session.cookie_httponly= 1
Don’t forget to remember remove(;) in from of session.cookie_httponly= 1
After that restart your server and check you found Secure flag
Note: If you not found secure flag then clear history or try on incognito mode
Output:-

Also read this
- How to change TLS version in xampp apache ?
- How to disable HTTP TRACE/TRACK (TraceEnable) methods in xmpp APACHE
- How to set Cookie Flagged ‘Secure’ in xampp apache ?
- Turn of Server Signature in xampp apache ?
- How to configure Proxy server In xampp Apache
- How to set SameSite cookie in xampp apache server ?
- How to set a cookie with the http only & secure flag in PHP?