Copy link to clipboard
Copied
I'm about to use CF Encrypt function because I need to pass a var via url.
In order to use Encrypt () I need to create a KEY but I don't want to keep setting this key on the page where I need to use Encrypt()
Can anyone point me to the right direction on where is the best place to set this key so I can just refer to this key anytime I need it?
Can I do <cfset session.MyEncyprteKey = ....>? and everytime I need this key I just use #session.MyEncryptedKey# ?
I'm using CF8 and Application.cfc
Copy link to clipboard
Copied
I would have thought you would set the key per application, rather than per user session. For example, in onApplicationStart:
<cfset application.key = generateSecretKey("Blowfish")>
You would then refer each time to application.key.