ad_user_logout (public)

 ad_user_logout [ -cookie_domain cookie_domain ]

Defined in packages/acs-tcl/tcl/security-procs.tcl

Logs the user out.

Switches:
-cookie_domain (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_fs_create_folder fs_create_folder (test file-storage) ad_user_logout ad_user_logout test_fs_create_folder->ad_user_logout ad_conn ad_conn (public) ad_user_logout->ad_conn ad_unset_cookie ad_unset_cookie (public) ad_user_logout->ad_unset_cookie parameter::get parameter::get (public) ad_user_logout->parameter::get sec_invalidate_session_id sec_invalidate_session_id (private) ad_user_logout->sec_invalidate_session_id sec_login_get_external_registry sec_login_get_external_registry (public) ad_user_logout->sec_login_get_external_registry packages/acs-subsite/lib/user-new.tcl packages/acs-subsite/ lib/user-new.tcl packages/acs-subsite/lib/user-new.tcl->ad_user_logout packages/acs-subsite/www/register/logout.tcl packages/acs-subsite/ www/register/logout.tcl packages/acs-subsite/www/register/logout.tcl->ad_user_logout sec_handler sec_handler (private) sec_handler->ad_user_logout

Testcases:
fs_create_folder
Source code:

    set external_registry [sec_login_get_external_registry]
    if {$external_registry ne ""} {
        #
        # If we were logged in via an external identity provider, try
        # to logout from there as well. Note that not every external
        # identity provider supports a logout (e.g. GitHub), and maybe
        # in some cases, the external logout is not wanted. This
        # should be provided by the implementation of the external
        # registry.
        #
        $external_registry logout
    }

    if {$cookie_domain eq ""} {
        set cookie_domain [parameter::get  -parameter CookieDomain  -package_id $::acs::kernel_id]
    }

    #
    # Make sure, this session_id is not accepted anymore.
    #
    sec_invalidate_session_id [ad_conn session_id]

    #
    # Use the same "secure" setting for unsetting the cookie as it was
    # used for setting the cookie. The implementation is not 100%
    # correct, for cases, when the parameter value for
    # "SecureSessionCookie" was altered during a session, but this
    # should be a seldom border case.
    #
    ad_unset_cookie  -domain $cookie_domain  -secure [expr {[parameter::get  -boolean  -parameter SecureSessionCookie  -package_id $::acs::kernel_id  -default 0] ? "t" : "f"}]  [security::cookie_name session_id]

    set external_registry [dict get [sec_login_read_cookie] external_registry]
    if {$external_registry ne "" && [nsf::is object $external_registry]} {
        #
        # Logout from external registry
        #
        ns_log notice "logout from external registry: $external_registry"
        $external_registry logout
    }

    ad_unset_cookie -domain $cookie_domain -secure f [security::cookie_name user_login]
    ad_unset_cookie -domain $cookie_domain -secure t [security::cookie_name secure_token]
    ad_unset_cookie -domain $cookie_domain -secure t [security::cookie_name user_login_secure]
Generic XQL file:
packages/acs-tcl/tcl/security-procs.xql

PostgreSQL XQL file:
packages/acs-tcl/tcl/security-procs-postgresql.xql

Oracle XQL file:
packages/acs-tcl/tcl/security-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: