Kicking a user

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

The following sample code shows how you can kick a user specified by their ID:

 

[C#]

 

using CMS.CMSHelper;

using CMS.SiteProvider;

 

...

 

        int userID = 10;

 

        // Get user object

        UserInfo ui = UserInfoProvider.GetUserInfo(userID);

 

        // Check if user exists

        if (ui != null)

        {

            // Kick user

            SessionManager.KickUser(userID);

        }

 

Page url: http://devnet.kentico.com/docs/5_5r2/devguide/index.html?api_online_users_kicking_a_user.htm