Forum > Networking and Web Programming
fpWeb and sessions
krolikbest:
Hi,
I would like to ask if is it current and proper way to use session like described in this topic: https://forum.lazarus.freepascal.org/index.php/topic,43256.msg302446.html#msg302446 ?
Leledumbo:
Just checked, the last attachement still works as expected, so yes.
krolikbest:
Thanks for checking. In the meantime, I realized my own idea for the sessions. In a nutshell, it involves using some sort of list, such as TStringList. There are stored so called session names (generated via Random procedure) when a new client (browser) logs into my http server. In few days I should show on my youtube some experiments with fphttpserver, pas2js, Raspberry Pi and esp8266 :)
egsuh:
HTTP Server may use TStringList for session management. But it's not portable to CGI model. Anyway I'm interested in your example.
Leledumbo:
The backend could be anything. Really the only connection a session has is its key cookie. Like egsuh said, though, TStringList won't survive one shot execution model employed by CGIs. Unless, you (Save|Load)FromFile accordingly. I usually just use Redis for session, as it has built-in expiration mechanism fully user controllable from query.
Navigation
[0] Message Index
[#] Next page