CodeIgniter Forums
Changing Session cookie - samesite v4.6.1 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Changing Session cookie - samesite v4.6.1 (/showthread.php?tid=92919)



Changing Session cookie - samesite v4.6.1 - codeus - 05-17-2025

Hi all,
Using v4.6.1 - in app/Config/Cookie.php - after changing samesite setting to 'None'

PHP Code:
    public string $samesite 'None'

Console error is:
Quote:Cookie “pm_id” has been rejected because it is in a cross-site context ...

Still get cross-site errors. I'm doing this for testing, connecting to the remote CI4 server from localhost on local machine.

I've tried using Cookie helper to no avail-:
PHP Code:
helper('cookie');
 
set_cookie('session_id'''3600'',''truetrue'None'); 

Is it possible to force samesite to 'None' for the CI session cookie?

Many thanks,
Mike


RE: Changing Session cookie - samesite v4.6.1 - paulbalandan - 05-17-2025

Just to confirm, are you the one setting up the cookie named "pm_id"? From your example, it seems the name is "session_id".


RE: Changing Session cookie - samesite v4.6.1 - codeus - 05-17-2025

(6 hours ago)paulbalandan Wrote: Just to confirm, are you the one setting up the cookie named "pm_id"? From your example, it seems the name is "session_id".

Confirmed: using 'session_id', or 'pm_id', the issue remains the same.