Server scope, or name them all the same application

-----Original Message-----
From: Terry Bader [mailto:[EMAIL PROTECTED]]
Sent: March 31, 2001 12:38
To: CF-Talk
Subject: RE: Seeing who's logged in - but a question on application
variab les between applications


is it possible to read variables from one application from another...

lets say you had an administrator page that was separate from the main site,
thusly a separate application name, but you wanted to see who was on...
could you actually read the mainsite.appliaction.user struct from the admin
site??

so far, i have used 5-10 min cached database queries to do this... but
wonder about the above...  could have other value as well...


        Terry Bader
        IT/Web Specialist
        EDO Corp - Combat Systems
        (757) 424-1004 ext 361 - Work
        [EMAIL PROTECTED]


        (757)581-5981 - Mobile
        [EMAIL PROTECTED]
        icq: 5202487   aim: lv2bounce
        http://www.cs.odu.edu/~bader






> -----Original Message-----
> From: Raymond B. [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, March 31, 2001 2:03 PM
> To: CF-Talk
> Subject: RE: Seeing who's logged in
>
>
> /* in the Application.cfm */
>
> // if user logging struct isn't there, make it so
> if (not isDefined('application.user')) {
>       application.user = structNew() ;
>       }
>
> // insert user's id and current time (for last access calcs)
> structInsert(application.user, session.uuid, now()) ;
>
>
>
>
> /* on the display page */
>
> // run through all the users that are logged in
> for (u in application.user) {
>
>       // if user's last access is older than their session
> timeout, remove them
>       if (dateCompare(application.user[u], dateAdd('n', -20,
> now()), 'n') lt 1) {
>               structDelete(application.user, u) ;
>
>       // else they might still be logged in, show them as such
>       }else{
>               writeOutput(u & application.user[u]) ;
>               }
>       }
>
>
> This is only to illustrate the concept, you'll want to do
> some heavy editing
> before you use it: Locking, copying to local vars for
> display, etc. are all
> things to consider. I have no idea the number of users you
> expect, etc. so
> you'll have to decide if this is right for you.
>
>
> -----Original Message-----
> From: W Luke [mailto:[EMAIL PROTECTED]]
> Sent: March 31, 2001 08:41
> To: CF-Talk
> Subject: Re: Seeing who's logged in
>
>
>
> Not sure I fully understand - could you show me an example
> bit of code?  I'm
> still not familiar with structures.
>
> Cheers
>
> Will
>
> > Yep, using the application scope just set a var in a struct
> (their id as
> > key, now() as value) then clean it up for all entries
> dateAdd('n', -<session
> > timeout>, now()) and you'll have a pretty good idea of
> who's logged in
> (w/in
> > the session timeout limit). Just make sure to lock the
> scope properly, you
> > can also do this db in the client vars if you want.
> >
> > -----Original Message-----
> > From: Yoshi Melrose [mailto:[EMAIL PROTECTED]]
> > Sent: March 30, 2001 16:17
> > To: CF-Talk
> > Subject: Re: Seeing who's logged in
> >
> >
> > Wouldn't session variables work for this? That's what I've
> used in the
> past
> > for anything that was sensitive to browser sessions. I know
> they're kinda
> > flaky sometimes, which is why I try not to use them.
> >
> > Any other ideas? I'd like to know any other suggestions as
> well, sounds
> like
> > something I could integrate into one of my own apps.
> >
> > ----- Original Message -----
> > From: "W Luke" <[EMAIL PROTECTED]>
> > To: "CF-Talk" <[EMAIL PROTECTED]>
> > Sent: Friday, March 30, 2001 5:29 PM
> > Subject: Seeing who's logged in
> >
> >
> > > Hi,
> > >
> > > On one of my sites users log in, and client.email is set - for the
> > > members-only sections, it then checks to see if
> client.email is set and
> > lets
> > > them in (or tells them to login) accordingly.  How can I
> add a "Who's
> > > online" section..to display which users are currently
> logged in? Because
> > > even if the user closes their browser, won't their
> token/cfid still be
> in
> > > the Database and therefore they'll appear "online" even
> though they're
> > not?
> > > Or have I lost the plot...(run out of Red Bull...coffee
> just doesn't do
> > > it...)
> > >
> > > Will
> > > --
> > > [EMAIL PROTECTED] -=- www.lukrative.com
> > > Local-Advertising -=- www.localbounty.com
> > >
> > >
> > >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to