Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

bufferoverflow's avatar

Store user identifier or session in other domains

I developed an embeddable button in order to allow my users to place purchase buttons in their custom-made websites such as WordPress.

The trick is that I need to fetch or create a record from the database if anyone wants to buy and consume the content and I made a login/register modal with the API. After we get the user we redirect to product checkout.

This is working fine but I was wondering what is the best way to remember this logged or registered user in my customer's websites so if they decide to buy another thing they don't have to login again if the session/cookie/whatever is present.

Is it fine to store the email in a cookie? Don't think anyone will try to put random emails in there, if not they will be paying the product for other people right?

Thanks

0 likes
0 replies

Please or to participate in this conversation.