Google Groups Home Help | Sign in
sessions and application.cfc
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Jim Priest  
View profile
 More options May 8, 1:25 pm
From: Jim Priest <pri...@thecrumb.com>
Date: Thu, 8 May 2008 10:25:36 -0700 (PDT)
Local: Thurs, May 8 2008 1:25 pm
Subject: sessions and application.cfc
Trying to get back up to speed on Mach-II.  I'm resurrecting my first
(and only) Mach-II app to reuse.  To update things I thought I'd try
to use application.cfc.

Now I'm having an issue with session variables.  I've got a
'checklogin' plugin that uses session vars - but onSession start
doesn't seem to be getting hit before the plugin is called and I get
an error that my objSession hasn't been defined.

How do I work around this??  I'm off to scour the archives and
hopefully someone has run into this before...

Jim


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Priest  
View profile
 More options May 8, 1:38 pm
From: Jim Priest <pri...@thecrumb.com>
Date: Thu, 8 May 2008 10:38:19 -0700 (PDT)
Local: Thurs, May 8 2008 1:38 pm
Subject: Re: sessions and application.cfc
On May 8, 1:25 pm, Jim Priest <pri...@thecrumb.com> wrote:

> Now I'm having an issue with session variables.  I've got a
> 'checklogin' plugin that uses session vars - but onSession start
> doesn't seem to be getting hit before the plugin is called and I get
> an error that my objSession hasn't been defined.

OK - found this quote (from Peter I think)

-------
If you are trying to create session objects at the beginning of the
request.  It's best to do that in the onSessionStart() method of your
Application.cfc -- I typically use that to call something like
getProperty("userFacade").onSessionStart() -- this assumes you have
stashed a reference of the userFacade in the mach-ii props and that
you
have created a method in your facade called onSessionStart.
-------

So how would I define this "userFacade" property?

Jim


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter J. Farrell  
View profile
 More options May 8, 3:10 pm
From: "Peter J. Farrell" <pe...@mach-ii.com>
Date: Thu, 8 May 2008 19:10:01 +0000
Local: Thurs, May 8 2008 3:10 pm
Subject: Re: [Mach-II] Re: sessions and application.cfc
To use the on the onSessiopnStart/end plugin points you need to be using Mach-II 1.6 BER. Do not define an onSessionStart method in your App.cfc as it is inherited from Mach.mach-ii. If you have an onSessionStart defined, then you need to call super.onSessionStart() at the end of you method.

Otherwise if you're using 1.5, you create a user facade and stash a reference in the M2 properties. Then use the approach you found on GG.

.Pjf


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Priest  
View profile
 More options May 8, 3:58 pm
From: Jim Priest <pri...@thecrumb.com>
Date: Thu, 8 May 2008 12:58:23 -0700 (PDT)
Local: Thurs, May 8 2008 3:58 pm
Subject: Re: sessions and application.cfc
OK - I can't move to 1.6 so that's out...

I've kludged it for now and it's working but would like to see an
example of "stash a reference in the M2 properties"??

So I'd have my user or session facade - with a "setupSession" method
or something... How would I put that into a property?   Can you
outline some pseudo-code??

Thanks for the help!
Jim

On May 8, 3:10 pm, "Peter J. Farrell" <pe...@mach-ii.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter J. Farrell  
View profile
 More options May 8, 11:11 pm
From: "Peter J. Farrell" <pe...@mach-ii.com>
Date: Thu, 08 May 2008 22:11:38 -0500
Local: Thurs, May 8 2008 11:11 pm
Subject: Re: [Mach-II] Re: sessions and application.cfc

A few questions:

- Are you using ColdSpring to manage your model?
- Do you have a session / user facade to leverage?

.pjf

Jim Priest said the following on 5/8/2008 2:58 PM:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Priest  
View profile
 More options May 9, 8:04 am
From: "Jim Priest" <pri...@thecrumb.com>
Date: Fri, 9 May 2008 08:04:04 -0400
Local: Fri, May 9 2008 8:04 am
Subject: Re: [Mach-II] Re: sessions and application.cfc
No ColdSpring.  I do have a 'session facade' setup.  Whether it's
'correct' or not - I'm not sure :)   My hack yesterday isn't working
so if I can't get this resolved I'm going to have to backtrack and use
Application.cfm until we can move to 1.6...

Thanks!
Jim

On Thu, May 8, 2008 at 11:11 PM, Peter J. Farrell <pe...@mach-ii.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter J. Farrell  
View profile
 More options May 9, 12:20 pm
From: "Peter J. Farrell" <pe...@mach-ii.com>
Date: Fri, 09 May 2008 11:20:59 -0500
Local: Fri, May 9 2008 12:20 pm
Subject: Re: [Mach-II] Re: sessions and application.cfc

Where are you creating the your SessionFacade.cfc?  If it's at the
Mach-II level, you can take a reference to that object and do
setProperty("sessionFacade", sessionFacade).  In your onSessionStart()
method in your App.cfc, then do <cfset
getProperty("sessionFacade").onSessionStart() />.  You'll have to create
on onSessionStart() method in your session facade (which would in turn
call the other session facade setters that need to be called).

Remember onSessionStart in your Application.cfc is only called when a
session begins, so it's a bit difficult to test.  The easiest way to
test is dump all your cookies (I like the web developer toolbar for
Firefox for this) so the next time you hit a page you get a new session.

.Peter

Jim Priest said the following on 5/9/2008 7:04 AM:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sean Corfield  
View profile
 More options May 11, 1:36 pm
From: "Sean Corfield" <seancorfi...@gmail.com>
Date: Sun, 11 May 2008 10:36:25 -0700
Local: Sun, May 11 2008 1:36 pm
Subject: Re: [Mach-II] Re: sessions and application.cfc

On Thu, May 8, 2008 at 12:58 PM, Jim Priest <pri...@thecrumb.com> wrote:
> OK - I can't move to 1.6 so that's out...

Out of curiosity, why not?

I tend to keep all my projects on the BER of all the frameworks as
much as possible because it saves this sort of frustration.
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Priest  
View profile
 More options May 11, 4:37 pm
From: "Jim Priest" <pri...@thecrumb.com>
Date: Sun, 11 May 2008 16:37:13 -0400
Local: Sun, May 11 2008 4:37 pm
Subject: Re: [Mach-II] Re: sessions and application.cfc

On Sun, May 11, 2008 at 1:36 PM, Sean Corfield <seancorfi...@gmail.com> wrote:
>  Out of curiosity, why not?

>  I tend to keep all my projects on the BER of all the frameworks as
>  much as possible because it saves this sort of frustration.

I'm a contractor for the Gov't and they move at a snails pace. We are
still on CF7, and moving to anything labeled "beta" is never going to
happen. :)

Jim


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google