Login/Applicationtoken/Session Variable Problem

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Login/Applicationtoken/Session Variable Problem

    I am having a problem with Logging in and Session variables. I am new to
    ColdFusion, but program in other languages including PHP and Java. Recently I
    got a new job and had to learn ColdFusion, I really like many of the things it
    can do with ease, but I'm stumped on a problem the previous programmer did not
    fix before he left.

    We use MX 6.1, Apache authentication and a query to get user roles in a
    modified Mach II framework. The problem is when we update frequently in
    develpment we get CFUSERNAME is undefined in SESSION. I'm honestly not
    completely sure why this is happening, but if we increment the applicationtoken
    by one it works again for awhile.

    Below is the login code we are using:

    <!--- login handling code --->
    <cflogin applicationtoken="dgf_dev_196">

    <!--- cflogin should be available once you are apache authenticated --->
    <cfif IsDefined("cflogin")>
    <!--- get roles for login name --->
    <cfstoredproc
    procedure="INTRA.WEB_INTRA_CONFIG.getRoles"
    datasource="intra_dev">
    <cfprocparam dbvarname="username" cfsqltype="cf_sql_varchar"
    value="#cflogin.name#">
    <cfprocresult name="temproles">
    </cfstoredproc>
    <cfset request.roles=ValueList(temproles.roles)>

    <cfif request.roles neq 0>
    <!--- set cfusion login setup --->
    <cfloginuser
    name="#cflogin.name#"
    password="#cflogin.password#"
    roles="#request.roles#">
    <cfset session.cfpassword="#cflogin.password#">
    <cfset session.cfusername="#cflogin.name#">
    </cfif>
    <!--- this should never happen if Apache .htaccess security is working --->
    <cfelse>

    <cfinclude
    template="/CF-INF/cftemplates/dev/Security/notAuthorized_view.cfm">
    </cfif>
    </cflogin>

    aggielaughs Guest

  2. Similar Questions and Discussions

    1. session variable problem
      I have a Session object set on Session_Start... I figured out that the object is never created... Cannot understand why.. Also I noticed that...
    2. ASP SQL Server Database Login - Session Variable
      Hello, I have a tough one for you guys. (Atleast I've been pulling my hair out trying to figure this one out.) Thanks for taking a look at this...
    3. session problem - login screen continually reloads after pressing the login button
      I am trying to get sessions to work on a log in screen to give certain users access to certain pages/directories. The problem is that when the...
    4. [PHP] Session and Server variable problem
      Thanks, but no. On the page not setting the cookie and the php.ini isn't setting it to either. But the .ini isn't setting it at all. Could I put...
    5. Session and Server variable problem
      Hi all, Have an interesting problem. Worked on a web site for a client. They have the server (IIS) set up and we are using php. Have been...
  3. #2

    Default Re: Login/Applicationtoken/Session Variable Problem

    There are a few updates and technotes that cover this. Be especially aware of
    any CFLOCATION calls that you may make after setting session variables.

    We ended up writing a check, on the first call to a session var, that bounces
    the user back to the login screen if the session var is missing (we wrote this
    before some of Macromedia's fixes and it works darn well).

    The updates can be found at:
    [url]http://www.macromedia.com/support/coldfusion/technotes.html[/url]

    Cheers,
    -- MikeR


    MikerRoo Guest

  4. #3

    Default Re: Login/Applicationtoken/Session Variable Problem

    Thanks! This has been driving us/me nuts for some time now. You're a life saver!
    aggielaughs Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139