intialise my session variables - in application.cfc
Is it ok to initialise my session variables in the application.cfc ?
eg. whenever a user visits the website I need to display a couple of session variables in my INCLUDED page_header
session.shopping_items eg. 4
session.shopping_value eg. £95.00
so I need to initialise these variables at some point. I could do this in the page_header with isdefined() or I thought I could do it in the application.cfc
is it ok to do it in the application.cfc ?
eg.
<cffunction name="onSessionStart" returnType="void" output="false">
<cfset session.unique_session_ref = CreateUUID()>
<cfset session.shopping_items=0>
<cfset session.shopping_total=0>
</cffunction>
Alternatively, instead of using session vars, I could just run a query on the "webCart" table and calculate the above values dynamically, but I thought that's an uneccesary performance hit ?
