One Time Access URL after purchasing subscription

Here's the scenario:

A client is selling a product which allows for ONE use of a Web App. The Web App has a simple URL, like www.company.com/app/the-awesome-tool (it's not publicly accessible)

I've been thinking on how to resolve this but can't wrap my head around it... the only thing I can think of is that after the purchase, the client is sent a UNIQUE URL that forwards him or her to www.company.com/app/the-awesome-tool (with masked URL), which then expires after accessing it. How can I achieve this? We have MemberPress installed, and can also install WooCommerc to resolve this. Thanks so much for your help!

Topic woocommerce-offtopic membership urls permalinks Wordpress

Category Web


A simple solution would be creating a unique token upon purchasing a subscription/product.

  1. Save to token somewhere in database.

  2. Present the URL to the app passing the token as a GET variable. For eample, www.company.com/app/the-awesome-tool/?token=jvp2HBst5V7iHQeE2twq

  3. When accessed, check is the token is there at the database, if not restrict access.

  4. Delete the token from database if the access was granted.

This could be extended by comparing user ID, order id etc.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.