Coldfusion Login System

Discussion in 'Programming' started by tech_dude, Feb 13, 2008.

  1. #1
    Hi

    I am looking into developing a login system for a coldfusion site that uses a session variable to determine whether or not the user is logged in.

    With the way i am doing it i am finding it hard as a novice to understand.

    My setup is that the form for the username and password is created in a .txt file which is then included and displayed on all pages allowing the user to log in from wherever they are.

    Can anyone give me a guide and some code which may help me learn how to do this.

    Thanks

    tech_dude
     
    tech_dude, Feb 13, 2008 IP
  2. Eriloo

    Eriloo Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Do a search for cflogin.
     
    Eriloo, Feb 13, 2008 IP
  3. unitedlocalbands

    unitedlocalbands Well-Known Member

    Messages:
    246
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    #3
    Are you using CFMX7? If so you can start here,


    Heres a list of what you will need,

    Application.cfc file,
    Login Form,
    Registration form,
    Database table to hold registered users information.

    Start with building an application.cfc file first.

    Here is a llink to a search on application.cfc so you can familurize yourself with what it is and how it works.

    http://www.unitedlocalbands.com/ser...000000;GFNT:0000FF;GIMP:0000FF;FORID:11&hl=en


    Here is what an example of what a simple application.cfc file looks like, you may use this one to get started
    
    <!---Initialize Application Component--->
    
    <cfcomponent output="no"> 
             <cfset this.name="[COLOR="Red"]PICK A NAME FOR YOUR APPLICATION[/COLOR]">
             <cfset this.clientmanagement="no"> 
    [COLOR="red"]Sessionmanagement must be set to "yes" to use session variables![/COLOR]
             <cfset this.sessionmanagement="yes">
             <cfset this.sessiontimeout=CreateTimeSpan(0,0,10,0)>
              
    	
      <!---Code in this section will run when the application starts--->
        <cffunction name="onApplicationStart"> 
        
            
            
            
    	</cffunction>
        
    	
        <!---Code here will run when a session starts --->
        <cffunction name="OnSessionStart" returntype="void">
        
        
        
        
        </cffunction>
        
    
        <!---Code here will run when a request happens--->
     <cffunction name="OnRequestStart">
    	 	<cfargument type="String" name="targetPage" required="true"/>	
    		
             
      
            <cfreturn true>
    </cffunction>	   
         
         
         <!---Code here runs when a session ends--->
         <cffunction name="onSessionEnd">
      	<cfargument name="sessionScope" type="struct" required="true">
        <cfargument name="appScope" type="struct" required="false">
        
        
        
        
    </cffunction>
    
    
    <!---Code here will run when the request ends--->
    <cffunction name="onRequestEnd" returnType="void">
       <cfargument type="String" name="targetPage" required=true/>
       
       
       
    </cffunction>
    </cfcomponent>  
    
    Code (markup):
     
    unitedlocalbands, Feb 14, 2008 IP
  4. lespaul00

    lespaul00 Peon

    Messages:
    283
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Unitedlocalbands will get you up and running on this - or, you could also search this forum for your question. We've discussed this type of a setup before, and it may be of use to check out. Plus, you'll uncover some other additional features.
     
    lespaul00, Feb 16, 2008 IP
  5. webrehash

    webrehash Peon

    Messages:
    163
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If you haven't solved the problem yet, here's a Dreamweaver extension that will create the log in and admin sections in coldfusion.
     
    webrehash, Mar 1, 2008 IP