Book Image

Railo 3 Beginner's Guide

By : Mark Drew , Gert Franz, Paul Klinkenberg, Jordan Michaels
Book Image

Railo 3 Beginner's Guide

By: Mark Drew , Gert Franz, Paul Klinkenberg, Jordan Michaels

Overview of this book

<p>Railo Server is one of the quickest ways to start developing complex web applications online. Widely considered as the fastest CFML (ColdFusion Markup Language) engine, Railo allows you to create dynamic web pages that can change depending on user input, database lookups, or even the time of day.</p> <p>Railo 3 Beginner's Guide will show you how to get up and running with Railo, as well as developing your web applications with the greatest of ease. You will learn how to install Railo and the basics of CFML to allow you to gradually build up your knowledge, and your dynamic web applications, as the book progresses.</p> <p>Using Packt’s Beginner's Guide approach, this book will guide you, with step-by-step instructions, through installing the Railo Server on various environments. You will learn how to use caches, resources, Event Gateways and special scripting functions that will allow you to create webpages with limitless functionality. You will even explore methods of extending Railo by adding your own tags to the server and building custom extensions. Railo 3 Beginner's Guide is a must for anyone getting to grips with Railo Server.</p>
Table of Contents (16 chapters)
Railo 3
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface

Time for action - creating a SESSION scope in your Application


Still within our myApp folder, edit the Application.cfc file and let's turn on session management—this tells our application that we want to enable sessions per user. We do this by adding <cfset this.sessionmanagement = true> in our code:

<cfcomponent>
<cfset this.name = "MyApplication">
<cfset this.sessionmanagement = true>
</cfcomponent>
  1. 1. If you now change the code in index.cfm to <cfdump var="#SESSION#"> and call the page, you will see the following:

  2. 2. Let's set a variable, so let's change our index.cfm to the following:

    <cfset SESSION.myID = "12345">
    <cfdump var="#SESSION#">
    
  3. 3. By running the code we now see that our variable myID is in the session:

  4. 4. Now that that variable has been set, let's remove the code <cfset SESSION.myId = "12345"> from index.cfm so that myID will not be set in the session scope again. When you reload the page, you'll still find our variable...