Hello! I have a community with nodebb hosted in a domain like forum.com, and a blog in a different domain called blog.com. From the blog I perform API requests to the forum using a plugin. I use credentials: 'include'
to perform such queries. They work correctly on chrome and firefox, however I'm getting the following warning on chrome
A cookie associated with a cross-site resource at http://forum.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.
I've been trying using the hook action:user.loggedIn
setting the session cookie as follows
// This function is called with the hook I mentioned before
Comments.onLoggedIn = function (params) {
console.log('params',params, arguments)
params.req.session.cookie.sameSite = "none"; // Also tried with "lax"
}
but the warning doesn't disappear and in fact when I try to make queries to NodeBB's api req.user
appears undefined
. Note that I need req.user
in order to make the API requests.
If you have any questions or need some clarification I'm happy to post them here.
Thanks in advance