title: jQuery ajax pass variable to php session, but php session not store it
body: <p>I try to add class to body, and store it in php session.
  I use ajax to do it, but php session not store it.
  Variable is passing correct.
  Session is started in php function.</p>
  <pre><code>(function ($) {
      jQuery(document).on('click', '#wcag-button', function () {
          $('body').attr('id', 'wcag-theme');
          $('#wcag-button').hide();
          $('#wcag-button-off').show();
  
          var data = {
              'action': 'wcag_contrast_on',
              'bodyClass': 'wcag-theme'
          }
          $.post(Theme_Variables.ajax_url, data, function(response) {
              console.log(response);
          });
      });
  })(jQuery);
  
  
  add_action('wp_ajax_wcag_contrast_on', 'wcag_contrast_on');
  add_action('wp_ajax_nopriv_wcag_contrast_on', 'wcag_contrast_on');
  
      function wcag_contrast_on() {
          session_start();
          $body_class=$_POST['bodyClass'];
          $_SESSION[&quot;usertemplate_css&quot;] = $_POST['bodyClass'];
          //echo 'You sent ' . $body_class;
          echo ($_SESSION[&quot;usertemplate_css&quot;]);
          $response['message']    = &quot;Successfull Request&quot;;
          echo json_encode($response);
          wp_die();
      }
  </code></pre>
  <p>I also try to start session in header, but not working.</p>