Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
431 views
in Technique[技术] by (71.8m points)

php - How to attach Tawk.to or Odoo chat to Codeigniter site? Is the problem with samesite cookies?

I have been trying to implement either Tawk.to or Odoo chat to my Codeigniter-based website. So far, it doesn't work. As I used inspect on the page, I saw some warnings about "SameSite" cookies.

Is there a way to deal with this?

My website is using CI 3 and PHP 7.3, so the method to change it in the config is not working for me. It even blocked my normal session data.

I've tried the following change in the applications / config / config.php file, but it doesn't work. It even blocked my default session data.

$config['cookie_prefix']    = '';
$config['cookie_domain']    = ''; 
$config['cookie_path']      = '/; SameSite=None';
$config['cookie_secure']    = TRUE;
$config['cookie_httponly']  = FALSE;

Another thing I tried is the following.

  1. A change in the application/config/config.php
ini_set('session.cookie_samesite', 'None');
ini_set('session.cookie_secure', TRUE);
  1. A change in the system/core/Security.php
setcookie(
$this->_csrf_cookie_name, 
$this->_csrf_hash, 
['samesite' => 'None', 
'secure' => true,
'expires' => $expire, 
'path' => config_item('cookie_path'), 
'domain' => config_item('cookie_domain'), 
'httponly' => config_item('cookie_httponly')]);

The results are the same. I still got the same warning that the cookies are not set to 'Secure' and thus both widget doesn't appear on the page. The warning I mentioned is the one in the 'Issue' tab when I open the "Inspect Page" of the website using Chrome. I tried using Firefox but it is the same too.

question from:https://stackoverflow.com/questions/66062719/how-to-attach-tawk-to-or-odoo-chat-to-codeigniter-site-is-the-problem-with-same

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...