Thursday, July 9, 2009

How do I create and use a session across multiple sites in ASP.net?

I want to create a session in ASP.net and then re-use it on another web-site running within the same IIS and server environment. More specifically, I want to run a webservice that creates the session, stores some information on the server, and returns a URL to one or more other sites. That URL may be passed from the original application, e.g. SSO client app, to a separate browser instance, possible residing on another machine.

How do I create and use a session across multiple sites in ASP.net?
Is this other machine accessible to you or are we talking about some totally different site on the internet?
Reply:It sounds like your webservice would use the initial credentials supplied on the first website. If the person is authenticated, the webservice would update the database, maybe using a GUID field to associate the authenticated person with future sessions. The URL generated for the next site would include the GUID. The next site would use the GUID to reclaim the information for the authenticated person via a different web method of the webservice and present appropriate content. The webservice would need to support the logout function. Also, the webservice must have a process to timeout a session so that the GUID would not be useful (stolen) for a long period of time. SQL Server 2005 supports GUID's so this mechanism makes the generation of a guaranteed unique ID easy.


No comments:

Post a Comment