title: secure web server asp.net
body: <p>I have a graphical user interface for my company product.
  I want to secure the data being sent back and forth between client and server.</p>
  
  <p>Is SSL one of the options? if yes, Please can some1 tell me the steps on how to implement it in my application code. </p>
  
  <p>Do i need to buy the certificate or can i make it.. which is the best choice?</p>
  
  <p>Any help is appreciated. thanks..</p>
  
  <p>I am logging in using FormsAuthenticationTicket as follows:</p>
  
  <pre><code>Session["userName"] = UserName.Text;
                      Session["password"] = Password.Text;
                      Session["domain"] = Domain.Text;
                      string role = "Administrators";
  
                      // Create the authentication ticket
                      FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(1,                          // version
                                                     UserName.Text,           // user name
                                                     DateTime.Now,               // creation
                                                     DateTime.Now.AddMinutes(60),// Expiration
                                                     false,                      // Persistent 
                                                     role);         // User data
  
                      // Now encrypt the ticket.
                      string encryptedTicket = FormsAuthentication.Encrypt(authTicket);
                      // Create a cookie and add the encrypted ticket to the
                      // cookie as data.
                      HttpCookie authCookie =
                                   new HttpCookie(FormsAuthentication.FormsCookieName,
                                                  encryptedTicket);
  
                      // Add the cookie to the outgoing cookies collection.
                      Response.Cookies.Add(authCookie);
  
                      // Redirect the user to the originally requested page 
                      Response.Redirect(FormsAuthentication.GetRedirectUrl(UserName.Text, false));
  </code></pre>
  
  <p>I am not sure how secure this is?? any suggestions.</p>