one of the documented procedures in this installation of the ACS
ad_partner_group_id_from_cookie   { cookie "" }
What it does:
Returns the group id for the specified partner cookie or for the cookie in the user's cookies. Memoizes the result.
Defined in: /web/philip/tcl/ad-partner-defs.tcl

Source code:

    if { [empty_string_p $cookie] } {
	set cookie [ad_partner_from_cookie]
    return [lindex [ad_partner_memoize_list_from_db  "select group_id 
               from ad_partner 
              where partner_cookie='[DoubleApos $cookie]'" [list group_id]] 0]