Currently my website is using aSession.cfm framework which needs to append session variables to every links. It is possible to automatically append a the variables to every url links without manually keyin the variables?
You might consider using 'application.cfm', in which you put all your variables. You can access them all over the site without having to add all the info at the end of the URL.
You best store the info in a cookie.
An example of such an 'application.cfm' is:
the following examples show how my current codes look like
<A href="linkX.cfm?<cfoutput>#cf_aSession#</cfoutput>">
link X</A>
<A href="linkY.cfm?<cfoutput>#cf_aSession#</cfoutput>">
link Y</A>
<A href="linkZ.cfm?<cfoutput>#cf_aSession#</cfoutput>">
link Z</A>
My codes should look like the following if I store the variable in application.cfm
On page linkx.cfm you can output the variable by using:
<cfoutput>#customer#</cfoutput>
Second:
------------
Linkx.cfm refers to a new webpage where you want to do something with the URL variable I guess.
Let's say you want to display the full name of the person (customer) who logged in on your website, you stored the customerID into the application.cfm file and on page: linkx.cfm you want to retrieve his info from the database (doing a cfquery)>.
Because the customers ID is stored in the application.cfm file you do not need to add it to the URL.
Just click on linkx.cfm and put an <cfoutput>#customer#</cfoutput>, you'll see that the customer ID (stored as a session variable) will be displayed!
Tip: Don't forget to check whether the customer has logged in on the website (otherwise you have no ID number).
This is done by checking the existance:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.