title: Add new value to cookie dynamically
body: <p>Im trying to add new value to a cookie, depending on which option you have choosed in an drop down menu. When you choose a option, the value of that option should be inserted into the cookie. When you choose another option, the new value of the option should be added to the cookie, and the old one should be replaced.</p>
  
  <p>I've tried this:</p>
  
  <pre><code>    var value;
      var id;
      var service_info;
      var service;    
      var connection; //Namnet på de tjänster som finns, nao_lan, stadsnat, tele osv English: The values of the options
      $.cookie("cookie_connection", connection);  //Creates cookie
  
  $('.type_of_connection').change(function(e) { //Visa vald tjänst och dess tillhörande div. Varje tjänst har en egen div.
  
      var show_connection = 1;    
      connection = $(this).val(); //Innehåller VILKEN tjänst man har valt ENGLIS: The option you choosed
      $.cookie("cookie_connection", connection);
      var divbox = null;  //Innehåller id:et på den div som skall visas.
      if(connection == "nao_lan") {
          divbox = "services_naolan";
      } else if(connection == "stadsnat") {
          divbox = "services_stadsnat";
      } else if(connection == "vadsl") {
          divbox = "services_vadsl";
      } else if(connection == "tele") {
          divbox = "services_tele";
      } else {
          divbox = null;
      }
      $.ajax({
              type: 'GET',
              url: 'summary.php',
              data: {connection: connection, show_connection: show_connection},
              dataType: "html",
              success: function(data) { $("#table_right #" + divbox).html(data).show(); },
              error: function(xhr, ajaxOptions, thrownError) { alert(thrownError); }
      }); 
  });
  
  
  $('#'+$.cookie('cookie_connection')+' :input').blur(function(e) {
      alert($.cookie('cookie_connection'));
      if(!$(e.currentTarget).val() == "") {
          service_info = $(e.currentTarget).val(); //Innehåller värdet i input-fälten
          id = $(e.currentTarget).attr('id');
          service = $.cookie('cookie_connection');
          $.ajax({
              type: 'GET',
              url: 'summary.php',
              data: {service_info: service_info, id: id, service: service},
              dataType: "html",
              success: function(data) { $('#table_right #services_'+$.cookie('cookie_connection')).html(data); },
              error: function(xhr, ajaxOptions, thrownError) { alert(thrownError); }  
          });     
      }
  });
  </code></pre>
  
  <p>AS you can see, im trying to add a new value to the cookie in the first function. Im going to use this cookie value later in the function below to generate the div that belongs to the cookie value. Anyone who can help me?</p>