Forum OpenACS Q&A: Response to Clickstream solutions

Collapse
Posted by carl garland on
At server startup make file with
if [catch {open $sessionpathfile w} fId] {
   ns_log Notice "Could not create session path file"
} else {
    puts $fId [ns_time]
}

At user session login:

nsv_set web_session_path $session_id ""

At pageload filter:

nsv_lappend web_session_path $session_id "$page_id [ns_time]"

At session logout:

If [catch {open $sessionpathfile a} fId] {
   ns_log Notice "Unable to append to session path file"
} else {
   puts $fId "$session_id [nsv_get web_session_path $session_id]"
} 
close $fId

At server shutdown


If [catch {open $sessionpathfile a} fId] {
   ns_log Notice "Unable to append to session path file"
} else {

     foreach s_id [nsv_array names web_session] {
     puts $fId "$s_id [nsv_get web_session_path $s_id]"
}	    
 
close $fId