(solved) Cookie issue with the chat (messenger) portion

For documentation of changes to the PGSocial Network extension
Post Reply
User avatar
Mandi
Site Admin
Site Admin
Posts: 47
Joined: July 31st, 2023, 8:37 pm
Location: Somewhere, Canada
Contact:

(solved) Cookie issue with the chat (messenger) portion

Post by Mandi »

There is, at least on Firefox, a warning regarding the cookie on the chat - messenger about same site=lax. Will be looking further into this.
User avatar
Mandi
Site Admin
Site Admin
Posts: 47
Joined: July 31st, 2023, 8:37 pm
Location: Somewhere, Canada
Contact:

Re: Cookie issue with the chat (messenger) portion

Post by Mandi »

Cookie issue is now resolved. Also added in the secure attribute for extra protection. For this fix go to ext/pgreca/pgsocial/styles/all/template/js and open the file pg_social_chat.js

Locate line 6 which looks like this:

Code: Select all

Cookies.set('pgsocial_chat', '');
Replace with this:

Code: Select all

Cookies.set('pgsocial_chat', '', { sameSite: 'lax',secure: true });
Locate line 31 which looks like this:

Code: Select all

Cookies.set('pgsocial_chat', Cookies.get('pgsocial_chat')+',0');
Replace with this:

Code: Select all

Cookies.set('pgsocial_chat', Cookies.get('pgsocial_chat')+',0', { sameSite: 'lax',secure: true });
Locate line 74 which looks like this:

Code: Select all

Cookies.set('pgsocial_chat', newcokie);
Replace with this:

Code: Select all

Cookies.set('pgsocial_chat', newcokie, { sameSite: 'lax',secure: true });
Locate line 171 which looks like this:

Code: Select all

if(cookie) Cookies.set('pgsocial_chat', Cookies.get('pgsocial_chat')+","+person);
Replace with this:

Code: Select all

if(cookie) Cookies.set('pgsocial_chat', Cookies.get('pgsocial_chat')+","+person, { sameSite: 'lax',secure: true });
Locate line 248 which looks like this:

Code: Select all

Cookies.set('pgsocial_chat', newcokie);
Replace with this:

Code: Select all

Cookies.set('pgsocial_chat', newcokie, { sameSite: 'lax',secure: true });
Post Reply