[Mono-list] mod_mono sharing application session data

Matthew Metnetsky met@uberstats.com
Thu, 29 Jul 2004 15:47:37 -0400


On Thu, 2004-07-29 at 13:14, Andrew Arnott wrote: 
> > This is very annoying.  Suppose you have an application (as I will soon)
> > where you have a Core module that supplies users, roles, etc and a
> > login.  From there you would travel to other modules which would of
> > course need to know that your logged in (a cookie works -
> > FormsAuthentication class).  But suppose I set your Member object into
> > Session within the Core module, the Foo module could not access it.  So
> > in fact I would have to check your cookie and retrieve again the Member
> > object associated to that cookie from the database.  Thus, an unecessary
> > call to the database, and two instances of the same object sitting in
> > session.  Its a data integrity nightmare!
> 
> In defense of your idea, it sounds very reasonable.  Having a site made up of
> several subdirectories doesn't mean it's a bad program to use the web as a
> platform.  Certainly sessions should span directories when it's the same web
> app.  IIS certainly treats it that way.
> 
> I unfortunately can't help though, as I have not done any work with sessions
> on Mono yet.  I have done it extensively in IIS however, and eventually would
> like to try porting it to Mono.

I believe I've solved my annoying problem.  It seems that the following
structure of directories will share session information.

/ - application login
/core
/foo
/bar

But I was doing the following, which definitely did NOT work.

/public - application login
/core
/foo
/bar

This does make sense - but the lack of documentation about any of this
is extremely annoying.  No where is this stated that I could find.  But
having thought about it, and related it to the way Web.config files load
it makes perfect sense.  

Any ways, BLAH.  Thanks.

~ Matthew