Note that there are some explanatory texts on larger screens.

plurals
  1. POServer Cookies?
    primarykey
    data
    text
    <p>I’ve inherited a rather convoluted project. The original designer created a “cookie” that appears to be server side rather than client based (though I could be very wrong on that part). He is using it for what he called “Least Privileges, Single Sign On”. I have the following code in all of the Web Service Proxies he set up:</p> <pre><code>[WebServiceBinding(Name = "ISecurityManager", Namespace = "urn:riv:apis:security:forms:ver1")] public partial class SecurityManager : SoapHttpClientProtocol, ISecurityManager { public SecurityManager() { //Url = CookieManager.WebServiceUrl(String.Empty, ref CookieContainer); // I’d like to replace the following code with a call like this... CookieContainer = new System.Net.CookieContainer(); string urlSetting = ConfigurationManager.AppSettings["SecurityManager"]; if (urlSetting != null) Url = urlSetting; else Trace.TraceWarning("No URL was found in application configuration file"); string cookieName = FormsAuthentication.FormsCookieName; string cookiePath = FormsAuthentication.FormsCookiePath; string cookieDomain = Properties.Settings.Default.CookieDomain; HttpCookie authCookie = HttpContext.Current.Request.Cookies[cookieName]; if (null != authCookie) CookieContainer.Add(new Uri(urlSetting), new System.Net.Cookie(cookieName, authCookie.Value, cookiePath, cookieDomain)); } …. </code></pre> <p>I also have this code pretty much <em>everywhere</em>:</p> <pre><code>string cookieName = FormsAuthentication.FormsCookieName; string SecurityContext.ApplicationName = HttpContext.Current.Request.Cookies[cookieName].Path; string SecurityContext.UserName = HttpContext.Current.User.Identity.Name; if (!string.IsNullOrEmpty(SecurityContext.UserName)) …. </code></pre> <p>In all instances, when it goes to get the authCookie, it comes up null or the SecurityContext.UserName is blank. I’m not a cookie guru and a lot of this guy’s code is obfuscated – and zero documentation.</p> <p>Can anyone make heads or tails out of the intent of the code blocks?</p> <p>TIA</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload