Skip to main content
added 239 characters in body
Source Link
Alex
  • 101
  • 3

Since users will be somehow authenticated during usage, you could "flag" trial accounts status and keep track of their activity:

  • User A logs in.
  • User A performs an action against the service
  • A combination of the user ID + timestamp is tracked
  • Check the earliest timestamp associated with the same user ID
  • IF the check passes (the earliest and the current are within the allowed interval), perform the requested action
  • ELSE you can deny the request (your trial "window" has expired).

This can get fancier and cover subscription plans and the like, it just needs a handful of easily handled flags. It's also tamper-proof to a certain degree, since it's all server-side (I'm not considering hacked account, but that's another issue).

This approach would start "counting" when users perform the first request. If you want to consider the interval start at the time of registration, you can simply "track" a fake action to provide you with a timestamp to compare against.

Since users will be somehow authenticated during usage, you could "flag" trial accounts status and keep track of their activity:

  • User A logs in.
  • User A performs an action against the service
  • A combination of the user ID + timestamp is tracked
  • Check the earliest timestamp associated with the same user ID
  • IF the check passes (the earliest and the current are within the allowed interval), perform the requested action
  • ELSE you can deny the request (your trial "window" has expired).

This can get fancier and cover subscription plans and the like, it just needs a handful of easily handled flags. It's also tamper-proof to a certain degree, since it's all server-side (I'm not considering hacked account, but that's another issue).

Since users will be somehow authenticated during usage, you could "flag" trial accounts status and keep track of their activity:

  • User A logs in.
  • User A performs an action against the service
  • A combination of the user ID + timestamp is tracked
  • Check the earliest timestamp associated with the same user ID
  • IF the check passes (the earliest and the current are within the allowed interval), perform the requested action
  • ELSE you can deny the request (your trial "window" has expired).

This can get fancier and cover subscription plans and the like, it just needs a handful of easily handled flags. It's also tamper-proof to a certain degree, since it's all server-side (I'm not considering hacked account, but that's another issue).

This approach would start "counting" when users perform the first request. If you want to consider the interval start at the time of registration, you can simply "track" a fake action to provide you with a timestamp to compare against.

Source Link
Alex
  • 101
  • 3

Since users will be somehow authenticated during usage, you could "flag" trial accounts status and keep track of their activity:

  • User A logs in.
  • User A performs an action against the service
  • A combination of the user ID + timestamp is tracked
  • Check the earliest timestamp associated with the same user ID
  • IF the check passes (the earliest and the current are within the allowed interval), perform the requested action
  • ELSE you can deny the request (your trial "window" has expired).

This can get fancier and cover subscription plans and the like, it just needs a handful of easily handled flags. It's also tamper-proof to a certain degree, since it's all server-side (I'm not considering hacked account, but that's another issue).