While migrating solutions and scripts from SP2010 to SP2013 “_spUserId” doesn’t work


When migrating solutions from and script from SharePoint 2010 to 2013, we ran into some weird error where we could not fetch the current logged in user with “_spUserId” anymore.

var user = _spUserId

As a workaround we used below;

var user = currentWeb.get_currentUser();

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>