Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I'd like to show the user id of the currently logged in user : I can get their name

// logged in?
            var wrapper = new HttpContextWrapper(HttpContext.Current);
            var ticket = wrapper.GetUmbracoAuthTicket();
            isLoggedIn = 0;
            sessionId = "";
            if (ticket!=null){
                if(ticket.GetRemainingAuthSeconds() > 0){
                    isLoggedIn = 1;
                }
                loggedInUsername = ticket.Name.ToString();
                sessionId = wrapper.Session.SessionID.ToString();
            }else{
                loggedInUsername = "";
            }

but I'd also like to get their user id so I can store extra user into in a separate database and look it up on the page.

I did try

@Umbraco.GetCurrentUmbracoUser().Id

but I think that's from an older version of Umbraco as it crashed Umbraco 7.4

share

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.