Identify if the user is paying server-side

is there a way to identify if the newly logged in user is a paying user or not? without using handlebars, such as a cookie.

I would like to identify if the login user is a paying user, server side.

What exactly do you mean you’d like to identify them server side? Have you got an example use-case you’re thinking of?

We can currently identify if the login user is a paying user, using handlebars. {{#if @member.paid}} ..{{/if}}

I don’t think we can do something like this directly with javascript for security reasons.

I would like to find out if there is any other way to identify if the login user is a paying user, but I would like to identify him before the page loads.
It occurs to me that I can use Nginx, hence the first server-side response.

For example, if a different but static cookie is set for paying users, compared to non-paying users, I could do something like this:

if ($ cookie_PayingUser = "1") {add_header ...; }

All of the handlebars templates are executed on the server, not in the browser, so there is no security issue there :relaxed:

@giacomosilli it would be easier to help you if you provide your actual use-case.

Asking for help with what you’ve tried based on your assumptions of what’s needed isn’t particularly useful. If you explain the end-goal of what you’re trying to achieve then we can give you direction for how to achieve that instead of limiting discussion to a very narrow technical assumption.

Why? What is it that you’d like to achieve by doing that?

You are right, I try to be as clear as possible, but I don’t have much more information than what I have already said.

We are developing software that adds specific sections to a website, for example a content of our interest that we want to show on some friends’ sites.

This software basically does what some ADS systems do, some of which set cookies faster than the rest of the site’s content. Our software does this too.

The goal is to set a cookie toggle to work on the very first request, only for paying users. Setting it via javascript does not set the cookie until AFTER the response gets to the client.

this is very important to me.

is it possible to know if it is possible or not?

if you need more information, I’ll give it to you

I suppose there is no way to fix this