c# - Forms Authentication in an ASP.NET app not being passed to new MVC app. Can it be done? -


i work 100's of asp.net (vb.net) web applications @ hospital use forms authentication. trying move mvc , within mvc app if check "system.web.httpcontext.current.user.identity.name" blank. if check same value in of other asp.net web apps value contains user information need. mvc app set forms authentication (as iis setting mvc app) code retrieve "system.web.httpcontext.current.user.identity.name" follows:

public static string currentuser {         {         string sessionlocation = string.format("basepage_currentuser{0}", system.web.httpcontext.current.user.identity.name);         if ((system.web.httpcontext.current.session[sessionlocation] == null) || string.isnullorempty(convert.tostring(system.web.httpcontext.current.session[sessionlocation])))         {             system.web.httpcontext.current.session[sessionlocation] = fhsbase.fhs.fhssettings.authenticateduser;         }         return convert.tostring(system.web.httpcontext.current.session[sessionlocation]);     }     set     {         string sessionlocation = string.format("basepage_currentuser{0}", system.web.httpcontext.current.user.identity.name);         system.web.httpcontext.current.session[sessionlocation] = value;     } } 

am missing something? why other asp.net apps see user new mvc blank?


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -