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

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -