I have a web service that has 8 web methods. These methods are called synchronously, the first call authenticates the user, and the rest of the methods perform a unit of work, these methods are called upon until the work is done.

I need to store the state of the work (e.g. what actions to perform next, and what work has been done and is currently being performed.) I currently have a state object that contains this information.

My question is what is the best way to persist this object between each web service call? Note that there may be multiple users calling this web service, each with it's own unique state. 

Here are some scenarios that I am thinking:

**Idea #1**

Store the object in a session.

**Idea #2**
Create an instance variable that is a HashMap of a userId and their respective data. something like:

```

[WebService(Namespace = "http://developer.intuit.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class QBWCService : QBWebConnectorSvc {

    // instance variable to hold current session data...
    private Dictionary<Guid,Session> Sessions;

    public QBWCService () {

        Sessions = new Dictionary<Guid,Session>();
    }
    [WebMethod]
    public override string[] authenticate(string strUserName, string strPassword)
    {
        ...
        Sessions.Add(UserId, new SessoionObject());
    }
 [WebMethod]
    public override string[] authenticate(Guid UserId)
    {
        SessionObject o = Sessions[UserId];
    }
}

```

I am thinking that Idea 2 is going to be the cleanest "natural way", however I do not know any of the implication of implementing this sort of scheme...which way or what else would you recommend?