======
logout
======

.. js:function:: logout()

**domain**: client 

**language**: javascript

**class** :doc:`Task </refs/client/task_api>`

Description
===========

Call ``logout`` to logout a user.


Example
=======

.. code-block:: js

    function on_page_loaded(task) {
        $("#title").html('Jam.py demo application');
        if (task.safe_mode) {
            $("#user-info").text(task.user_info.role_name + ' ' + task.user_info.user_name);
            $('#log-out')
            .show()
            .click(function(e) {
                e.preventDefault(); 
                task.logout();
            });
        }
        // some initalization code
    }

See also
========

:doc:`load <m_load>`

:doc:`login <m_login>`

:doc:`user_info <at_user_info>`

:doc:`Users </admin/users>`

:doc:`Roles </admin/roles>`