title: Session Variable in WCF Service
body: <p>I am just creating a normal wcf service which get the Person object and returns the List. I need to save incoming Person object in a session and returns the list. I have implemented the code like below</p>
  
  <pre><code>[AspNetCompatibilityRequirements(RequirementsMode= AspNetCompatibilityRequirementsMode.Required)]
  public class Service1 : IService1
  {
      public List&lt;Person&gt; getPerson(Person person)
      {
          List&lt;Person&gt; persons;
          if (HttpContext.Current.Session["personList"] != null)
          {
              persons = (List&lt;Person&gt;)HttpContext.Current.Session["personList"];
          }
          else
          {
              persons = new List&lt;Person&gt;();
          }
          persons.Add(person);
          HttpContext.Current.Session["personList"] = persons;
  
          return persons;
      }
  }
  </code></pre>
  
  <p>But always i got only the object i passed in the parameter. Not the entire collection. So always session is returns null. What i missed?</p>