ColdFusion
  Home arrow ColdFusion arrow Page 2 - How to Create a Simple Cold Fusion Login
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
COLDFUSION

How to Create a Simple Cold Fusion Login
By: Aaron Schaap
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 44
    2004-02-25

    Table of Contents:
  • How to Create a Simple Cold Fusion Login
  • Example With Login Check

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    How to Create a Simple Cold Fusion Login - Example With Login Check


    (Page 2 of 2 )


    <!--- application.cfm -->
    <
    cfapplication name "myapplication" 
          sessionTimeout 
    #CreateTimeSpan(0, 0, 0, 60)# 
          sessionManagement = "Yes">

    <cfif not IsDefined("LoggedIn")>
     
    <cflocation url="login.cfm">
    <cfelse>
     
    <cfset LoggedIn="yes">
    </cfif>

    Login.cfm

    The <cfif> tag above checks to see if a variable called LoggedIn was defined. If not, the user is redirected to login.cfm.

    Below is a simple login.cfm file.


    <!---login.cfm--->
    <
    cfform name="loginform" action=”put name of page where the login is checked>
    User Name:  <cfinput type="text" 
     name
    ="username"
             required
    ="yes">
    Password:  <cfinput type="password" 
     name
    ="password"
     required
    ="yes">
            
    <!--add in code to check login against database-->

    <cfinput type=”Submit”>
    </cfform>

    This example uses the <cfform> tag to create a form with a text box and a password box.

    The action would be a cold fusion template that would have a SQL query requests information from the database. If the user is authenticated, the variable LoggedIn would be set to “yes” and the user would be allowed access to the site.

    If the user is not authenticated, they could be provided with a registration page.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    COLDFUSION ARTICLES

    - How to Access a SQL Anywhere Database with C...
    - CFXML: Probing XMLDOM in ColdFusion
    - Creating a Web Service with ColdFusion: the ...
    - CFAjax: What it is and How to Use it
    - Querying SQL 2000 Server from ColdFusion
    - Introduction to ColdFusion Markup Language, ...
    - Introduction to ColdFusion Markup Language
    - Databases and Dreamweaver MX 2004, concluded
    - Databases and Dreamweaver MX 2004
    - Welcome to Coldfusion MX 6.1, concluded
    - Welcome to Coldfusion MX 6.1
    - What You Must Know About ColdFusion Flow-Con...
    - What You Must Know About Operators in ColdFu...
    - Everything You Must Know About ColdFusion Va...
    - My First Application on ColdFusion MX Server






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT