Membership site

I am building a membership site with different access levels.

Currently I am struggeling with the design of when a user upgrades (or their membership expires and a downgrade is needed).

One of the designs I am thinking of is having a cronjob check if they need to be downgraded

One other solution could be is to have an expiry on the auth-assignment record…

What suggestions do you have, how would you implement this ?

Membership expiry is OK to do via cronjob. Upgrade should be done immediately since users will go check it right away.

Thanks… I was hoping to avoid cron so that if cron failed for whatever reason, the user is still expiring

Another way is to store expiration date in a column of a user table and check it every time user does what’s to be restricted. This way there will be no lag and cron isn’t needed.