Skip to main content
Inspiring
November 4, 2008
Question

site flow

  • November 4, 2008
  • 2 replies
  • 294 views
What is the prevailing wisdom, is it generally better to <cfif> at the most (more) root levels? Specifically as an example:

Scenario 1: index.cfm has <cfif isDefined(SESSION.auth.isSignedIn)> and then route every new page call through index.cfm each and every time

OR

Scenario 2: index.cfm is for visitors who upon signin are routed via signin.cfc to index4Members.cfm or even a . . /Members/index.cfm that has cf protection applied to the (which I have no direct experience in mind you).

Obviously the cat can be skinned both ways but the site I am in the midst of is extremely comprehensive and threatens to become spaghetti logic all too quickly. Also I know that MVC and FuseBox etc purport to address this sort of issue but to my research to date they are (for me at this point) another layer of "learning". As always, thanks in advance for any and all feedback.

    This topic has been closed for replies.

    2 replies

    Inspiring
    November 4, 2008
    I think the best place to check the user's logged in status is the onRequestStart method of your application.cfc file. This will deal with bookmarked pages and the like.
    Inspiring
    November 4, 2008
    this (using onRequestStart) makes sense, but looking at the docs ( http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00001175.htm#1100022) either i don't quite get it or what I am trying to do doesn't apply.

    FWIW at the moment I am putting a <cfif isDefined(SESSION.auth.isSignedIn) as the first (and only) listing in my index.cfm based on it <cflocation> users to either Members.cfm or Visitors.cfm. Thoughts?
    Inspiring
    November 4, 2008
    i guess it really depends on how different is the content for members
    and non-members...

    on some of the sites i made, the members content is very different from
    general content, so i keep it all in a separate dir only accessible to
    authenticated users.
    on other sites, where members just get a few extra features in addition
    to generally-available content (i.e. non-watermarked photos for
    signed-in members instead of photos with watermark for general public),
    it is all same pages with <cfif> flow added.

    hth

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/