Free public hot spot with basic authorization

Hi,

We are trying to setup free hot spot with simple authorization. Right now we need help with mikrotik authorization based on cookies.
Is it possible to setup mikrotik in this way (and how to do this):

  1. Authorization on server with PHP (checking user ID) – writing cookie
  2. Mikrotik reading cookie file (valid 12 hours)
  3. Redirecting to authorization server with PHP when:
    a. User is not authorized
    b. User cookie file is older than 12 hours
    We read FAQ and other posts but right now we have problems with this setup.

Kind regards
Mateusz

Planning to give free Hotspot, configure..“Trial” from
/ip hotspot server profile