Forum > Networking and Web Programming

fpWeb and sessions

(1/2) > >>

I would like to ask if is it current and proper way to use session like described in this topic:,43256.msg302446.html#msg302446 ?

Just checked, the last attachement still works as expected, so yes.

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 :)

HTTP Server may use TStringList for session management. But it's not portable to CGI model. Anyway I'm interested in your example.

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.


[0] Message Index

[#] Next page

Go to full version