c# - Static Method for user Id Asp.Net -
we using static property within application fetch username siteminder. problem facing though every time access property calling method inside statement fetch user name, username getting shared across users. i.e. if user1 has logged in application gets value user2. can approach should following. cannot use session , there around 100+ screens accessing property.
public static string userid { get{ string userid = "admin"; if (configurationmanager.appsettings["siteminderauth"].tostring() == "true") { // collection of available http headers request namevaluecollection coll = httpcontext.current.request.headers; // retrieve userid siteminder header sm_user userid = coll["sm_user"].split('\\')[1]; } else { userid = configurationmanager.appsettings["siteminderauth"].tostring(); } return userid; } }
Comments
Post a Comment