Hi,
I would like to know if there is a Cookie that is automatically set when a paying user logs in?
Basically there is a cookie that identifies a user logged in with an active stripe plan?
If it does not exist, is it possible to set a cookie only for paying users on the server side without compromising the Ghost core and without being overwritten with each update?
currently in my template I have the current condition:
if member.paid {
// cookie
}
I am testing a system of ADS that inject scripts into my template, unfortunately these scripts are loaded before my template sets the cookie even if I set it in the header and i can’t change the banner injection time.
In addition to the ADS, I intend to also use other services, active/inactive only for paying users or not, I would like to be able to use the cookie and set it immediately before all the other scripts, but certainly I must be able to know if the login was carried out by a paying user or not.
About the cookie you’re right, I had also missed this domain=;, with this parameter cookies are not duplicated, I set cookies as session.
I already do the refresh with window.location = '/'; , I would like to avoid these practices and make everything more linear and userfiendly.
there is currently no way to identify from the url or from cookies if a user is paying, right? it would be interesting to try to set cookies here like this:
if (action == 'signin') {
$('body').addClass("signin-success");
if(paid){
setCookie();
}
}
Reading from the URL wouldn’t be ideal as a user could put whatever search string they wanted to, and all of our cookies are “HTTPOnly” and unable to be read or modified by client-side code!
Right, while I was writing it I thought about it.
It would be interesting if you can create a cookie or something in the future that identifies whether the user is paying or not.