colosoderada
Programmer
How can I make a global variable in ColdFusion?
If I have created
<!-- Application.cfm -->
<cfset APPLICATION.Identificador ="1">
<cfset APPLICATION.CategoriaUsuario="5">
<!-- In other page for example Ad.01 -->
variables.categoria = 10
variables.idusuario = 20
<cfset APPLICATION.CategoriaUsuario='#variables.categoria#'>
<cfset APPLICATION.Identificador ='#variables.idusuario#'>
I want change the values of my variables.
APPLICATION.CategoriaUsuario = 10
APPLICATION.Identificador = 20
If I´m in the pages Ad.01 and I do this
<cfoutput>#Application.Identificador#</cfoutput>
<cfoutput>#Application.CategoriaUsuario#</cfoutput>
I obtain the correct value (I think that I have change the value of the applications variables).
APPLICATION.CategoriaUsuario = 10
APPLICATION.Identificador = 20
But when I change to another pages for instance Ad.02 and
I make this
<cfoutput>#Application.Identificador#</cfoutput>
<cfoutput>#Application.CategoriaUsuario#</cfoutput>
The values of the variables are the initial values
APPLICATION.Identificador ="1"
APPLICATION.CategoriaUsuario="5"
Why???? The variables hasn´t change their values.
APPLICATION.CategoriaUsuario = 10
APPLICATION.Identificador = 20
How can I change the value of my variables?
Thank you very much.
Sorry for my english. I´m from Spain
If I have created
<!-- Application.cfm -->
<cfset APPLICATION.Identificador ="1">
<cfset APPLICATION.CategoriaUsuario="5">
<!-- In other page for example Ad.01 -->
variables.categoria = 10
variables.idusuario = 20
<cfset APPLICATION.CategoriaUsuario='#variables.categoria#'>
<cfset APPLICATION.Identificador ='#variables.idusuario#'>
I want change the values of my variables.
APPLICATION.CategoriaUsuario = 10
APPLICATION.Identificador = 20
If I´m in the pages Ad.01 and I do this
<cfoutput>#Application.Identificador#</cfoutput>
<cfoutput>#Application.CategoriaUsuario#</cfoutput>
I obtain the correct value (I think that I have change the value of the applications variables).
APPLICATION.CategoriaUsuario = 10
APPLICATION.Identificador = 20
But when I change to another pages for instance Ad.02 and
I make this
<cfoutput>#Application.Identificador#</cfoutput>
<cfoutput>#Application.CategoriaUsuario#</cfoutput>
The values of the variables are the initial values
APPLICATION.Identificador ="1"
APPLICATION.CategoriaUsuario="5"
Why???? The variables hasn´t change their values.
APPLICATION.CategoriaUsuario = 10
APPLICATION.Identificador = 20
How can I change the value of my variables?
Thank you very much.
Sorry for my english. I´m from Spain