Topic: Best place to set a session in cfc


donboe    -- 10-20-2011 @ 11:21 AM
  I have a multiple language website. I wonder where in my Application.cfc I should set the language session!

This is the session I declare:

<cfif Not structKeyExists( session, 'language' )>
  <cfset session.language = "eng" />
<cfelseif structKeyExists( Url, 'language' )>
  <cfset session.language = Url.language />
  <cfcookie name="language" value="#Session.language#" expires="never">
</cfif>


Would onApplicationStart be the best place or should I stick it in OnRequestStart.

“Good artists copy, great artists steal.” (Papblo Picasso)


Cfdevshop    -- 03-20-2013 @ 11:34 PM
  in application.cfc
<cfset this.sessionManagement = true>
mention session on onApplicationStart

Coldfusiondevshop


EasyCFM.COM ColdFusion Forums : http://archive.easycfm.com/forums
Topic: http://archive.easycfm.com/forums/viewmessages.cfm?Forum=12&Topic=15227