title: How to store credentials in Web application to access webservice?
body: <p>I am working on an application where I need to store a user credentials to access webservice to perform different operations through out user session and finally destroy the credentials.</p>
  
  <p>1.User Enters credentials in Login Screen (Using Forms Authentication)
  2. I am Capturing credentials and storing it in session as below:</p>
  
  <pre><code>   Webservice webService = new Webservice();
      CredentialCache cache = new CredentialCache();
      cache.Add(new Uri(webService.Url), // Web service URL
                 "Negotiate",        // Kerberos or NTLM
                 new NetworkCredential(userName, pwd, domain));       
      webService.Credentials = cache;
      HttpContext.Current.Session["webService"] = webService;
  </code></pre>
  
  <p>I am not sure whether this is a correct way of doing it or not. As I need this webservice object throughout the session scope I am using above logic.</p>
  
  <p>Please some one suggest me how can I accomplish this.</p>
  
  <p>My application is not a SSL enabled application(Http).</p>