Forum OpenACS Q&A: Response to How to keep trace of server-side state?

Collapse
Posted by Jonathan Ellis on
Sure, you could store this in a table. You could define a proc like
proc_doc ad_track_user { } {
    records the script  the user is in
} {
    set u_id [ad_get_user_id]
    set u_script [info script]
    db_dml track_i "insert into user_tracking(user_id, script, when) values (:u_id, :u_script, now())"
}
The reason most people don't do this is that depending on your user load it could be pretty hard on your db to do an insert/update with every page load. For a low traffic site though this could be fine. For something more advanced, try the ASJ clickstream article.