Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Difference between Application Scope and Session Scope

Contributor ,
May 01, 2006 May 01, 2006
I have been strugling with disappearing sessions. Can some one explain to me the big difference b/w Session Variables
and Application Variables? Below is my code
<cfif IsDefined("url.referer")>
<cflock scope = "Session" timeout = "30" type = "Exclusive">
<CFSET session.referer= #url.referer#>
</cflock>
</cfif>
The main purpose if to track where user is coming from and passed through the Url below is what I have in my application.cfm
<cfparam name= "Session.referer" default="">
But for some reason when the user clicks on a form that is stored in another folder the session variables disappears.
TOPICS
Getting started
1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 02, 2006 May 02, 2006
The standard variable is cgi.http_referer, not url.referer.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 03, 2006 May 03, 2006
The differences are:

session scope variables are ONLY available to that SESSION. So you would use them for information that ONLY pertains to the current browser session. User IDs, User preferrences, etc. It is the same type of information that you would store in a COOKIE, but is on the CF Server instead of the CLIENT COOKIE. User A and User B get different data each via the sesion scope. user A can not read session scope varaibles set by user B. Another advantage of session scope variables is the ability to store complex data types like arrays, querys and invoked cfcs. The session scope variable lasts as lok as the session time out is set in the administrator, or the application tag.

APPLICATION scope is a SHARED scope that is accessable to all scripts within an application as defined by the application tag. user A and user B on your appliation get the same data from the application scope. Application variables last as long as the timeout in the administrator or application tag is set to.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 03, 2006 May 03, 2006
LATEST
please read the cfml reference.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources