title: Defining variables in cfscript ColdFusion?
body: <p>I tried to rewrite my <code>Application.cfc</code> and other <code>.cfc</code> files in my system with <code>cfscript</code>. There is few things that I'm not sure how they work in cfscript. I'm wondering about defining variables inside of the functions. For example <code>onRequestStart()</code> function looks like this:</p>
  
  <pre><code>function onRequestStart(required string thePage) returntype="boolean" output="false" {
          var request.appCode = "MyApp";
          var request.appName = "Single Page Application";
          var page = listLast(arguments.thePage,"/");
          var onApplicationStart();
  
          if(!listFindNoCase("Home.cfm,Auth.cfc",page)){
              if(structKeyExists(SESSION, "loggedin") AND SESSION.loggedin EQ false){
                  location(url="https://www.myapp.org", addToken="false");
              }
          }
  
          return true;
      }
  </code></pre>
  
  <p>Do I need to use <code>var</code> word in situations where I'm defining <code>request/session</code> variables? If I do what is the best practice, use var word or use <code>local.variablename</code>? Is <code>local</code> and <code>variables</code> same in <code>cfscript</code>?</p>