Re: Session State across ASP.NET apps

From: Cowboy (NoSpamMgbworld_at_comcast.netNoSpamM)
Date: 06/01/04


Date: Tue, 1 Jun 2004 08:07:05 -0500

Set the encrypt and decrypt key to the same value in each web. Then, set the
authentication cookie name (forms auth) to the same name. This will
authenticate the user once for any number of servers. NOTE: If you farm, you
will have to use the same Session Server for all machine (I have not
personally tested this, however).

For session variables, I have yet to have found a solution. Currently, we
persist session vars in a SQL Server database with a timestamp (cleared out
12 hours later). You can then grab the vars in the other app.

I have a theory that placing the applications in the same pool in IIS might
allow sharing of session vars, but have not tested it. Another possibility
is to set up a web service in each app to pass vars to the other app. Since
the web service would recognize the session ID, it could pass back the info.
NOTE: For high security, you would have to encrypt the data before throwing
into the web service return, as a sniffer could get session IDs and query
your web service. I have not tested this yet, either.

As for the article you link to, you can do what the article suggests without
the massive delete, edit the .webinfo file crap if you set up the parent app
and make the other "apps" subdirs of the parent app (importing, if child
apps already completed). This is really a non-solution for most of us, as
you are essentially killing the child apps and making a single parent app
with all of your applications. You cannot set up the application on a unique
CName, like app1.mydomain.com, as it is tied to the other apps*. Yuck!

* Actually, there is a way to kludge that too, but also not recommended.

-- 
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
************************************************
Think Outside the Box!
************************************************
"Mark" <maxmann@kc.rr.com> wrote in message
news:%23LxXX$0REHA.2404@TK2MSFTNGP09.phx.gbl...
> Ok, I know that .net inherently does not share session data across asp.net
> projects, but is there any decent work around to this.
> We already have a big chunk of our application using the asp.net session
> object (using state service).  I'd like to start breaking out
> our functionality into component projects, but I'd like to get this
session
> issue worked out first.
>
> Any ideas??
>
> I found this article , but it sounds like kind of a pain.
>
> http://www.asp101.com/articles/jayram/sharestate/default.asp
>
>
>


Relevant Pages

  • Re: Session State across ASP.NET apps
    ... Using the application object will persist data in the application collection and make it available to all sessions in an app, but there's no way to restrict access. ... - Use a SQL database to persist session variables at the end of each session. ... You can think of the msmq as a robust ... >> is to set up a web service in each app to pass vars to the other app. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Session State across ASP.NET apps
    ... we are already using a central state server for all web ... so I knew about the encrypt decrypt thing for that. ... I'm just talking about sharing the session between apps. ... You can then grab the vars in the other app. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP.NET Application - Defined???
    ... > gateway to the app). ... > business object into session state. ... > - Then Main.aspx did the bus obj user validation and filled out the rest ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Safest way to pass data between web apps?
    ... Or simply a generated/custom session ID. ... form which you post to the receiving application, ... >> data across to the other app and the "receiving" app can extract only ... >> - Paul Glavich ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Session timeout problem...
    ... During the login, in code behind I have dynamically created a public shared ... When the user clicks logout menu option from my app I also have code behind ... session will time out. ... ran some test code in the application start sub in global.ascx to log each ...
    (microsoft.public.dotnet.general)