EasyCFM.COM ColdFusion Forums / Coding Help! / Best place to set a session in cfc

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Best place to set a session in cfc

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

donboe
10-20-2011 @ 11:21 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 474
Joined: Nov 2004

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
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Member
Posts:
Joined: Mar 2013

in application.cfc
<cfset this.sessionManagement = true>
mention session on onApplicationStart

Coldfusiondevshop


Website Designed and Developed by Pablo Varando.