mardi 23 septembre 2008

Session lost after directory addition on an site

During the development of a site creating directories, iIdiscover that IIS lost his session on each directories modification.

Fortunatly provide a service to store session out of your website : ASP.NET State Service.

First step is to start the service and request it to start autmtically.
Two parameters can be set in the registry : the port to use and if the service can be reach from a remote computer.

By default the port is : 42424

Now the service is configured and running, the last step is to add a new section in your web.config file :


In this example, the session is stored in the state server, but it's also possible to store it in a Sql server database.

Of course, each objects store in session must be serializable

Aucun commentaire: