PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, March 9, 2022

[FIXED] Php: Set header for cookie attribute SameSite=None;Secure is not working at all

 March 09, 2022     codeigniter, cookies, header, php, samesite     No comments   

Issue

I know there is many solutions given regarding the same question but I tried all of them and none of them working at all.

I am tried following ways but none of them worked. My php version is 7.1 and Codeigniter framework I am using.

By setting header in index.php

header('Set-Cookie: HttpOnly; SameSite=None;Secure');

By setting in .htaccess

Header edit Set-Cookie ^(.*)$ "$1;HttpOnly;Secure;SameSite=none"

By setting in apache2 httpd.conf

Header edit Set-Cookie ^(.*)$ "$1;HttpOnly;Secure;SameSite=None"

I have reviewed Chrmoe git updates, it says header('Set-Cookie: cross-site-cookie=bar; SameSite=None; Secure');

I didn't get the option cross-site-cookie=bar. What will be value for it.

I also tried the same one but it didn't work at all.


Solution

Hello I have solved this issue by following. Hope it will help to others

In httpd.conf (For bitnami server file will be /opt/bitnami/apache2/conf)

Header always edit Set-Cookie ^(.*)$ $1;Secure;SameSite=None


Answered By - Dhara
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing