0

I am trying to have new users register to my site from an AMP page. However, if the user is a logged-in member, I do not want to show a meter/or registration wall.

Currently, I can check the log-in status via cookies or tokens, but without javascript, and not making a call to an endpoint to check the user's log-in state, the AMP page does not know whether the user is logged-in or not.

I know that the reader_id that is set by the AMP ecosystem can see if a user is logged-in or not, but that is not the case if the logged-in user arrived on the AMP page from a non-AMP page or non-AMP initiated log-in page.

Is there any way for my AMP page to know if a user is logged in through cookies, tokens, API calls? And subsequently add logic to show/hide the registration wall based on the logged-in state?

Brandi
  • 161
  • 1
  • 10
  • I have various ways of checking logged-in users outside of the log-in page. For instance, a user can land on an article from our email blast and the token logs them in. How will AMP know they are logged-in users if they have not signed in through the login page (i.e., the login url I provide in the initialization JSON)? – Brandi Apr 11 '19 at 14:02
  • Server Side loads before AMP is outputted. So you can simply program via your server side language (Ie PHP) to check the cookies for logged in users and output html accordingly. – imvain2 Apr 11 '19 at 21:37
  • Our articles can be cached so I won't be able to do it in the backend. Btw, php is not in our stack – Brandi Apr 16 '19 at 14:10

0 Answers0