Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • arun 2 posts 72 karma points
    Oct 02, 2017 @ 09:25
    arun
    0

    Admin Session At Client Side

    I have a button on my Home page, i have to show it for the admin users only is it possible to validate the admin session at selected client side pages

    if they try to directly hit particular page i have to redirect them into Login Page. once the admin logged in i have to redirect them in to my custom pages

    or else i have to show my custom page in Admin side ?

    please guide me on this

  • Tobias Klika 101 posts 570 karma points c-trib
    Oct 03, 2017 @ 15:23
    Tobias Klika
    0

    I do this by querying the following:

    FormsAuthenticationTicket ticket = new System.Web.HttpContextWrapper(System.Web.HttpContext.Current).GetUmbracoAuthTicket();
    bool isLoggedIntoBackoffice = ticket != null;
    

    This verifies if the user is logged into the backoffice.

Please Sign in or register to post replies

Write your reply to:

Draft