CodeShare Refresh: HTTP Session Limit
Shouldn't the code in line 5 be using the '-count' option to get the current table size? As it reads it is returning the value of the first entry in the table...
12: if {not ([table keys -subtable httplimit -count] > $static::max_active_clients)} {
Also, I'm a bit confused on the logic using the 'after 60000' to retouch the table entry. If the entry times out in 180 seconds, it will disappear by itself and thinking logic to have the client retouch it with each HTTP_REQUEST will refresh it. This seems to be connection based as the CLIENT_CLOSE drops the entry from the table even though the user still has a web session (and cookie).
I may be trying to use this incorrectly. I have a web service where I need to restrict the number of overall concurrent users. The application uses JSESSIONID so thinking I could use that existing cookie. I can then add a table entry for the user if I don't have them and retouch it for every transaction to keep it active. Once they go away it will timeout and the entry will drop, opening a session slot for someone else.