It doesn't have anything to do with your locks, or what you're naming them. I think you're misunderstanding the concepts here, so I shall explain
Basically, you have a session "scope," and any variables that you put into it are tied to the current user that is navigating your site (i.e. running that .cfm page). However, every user has their own session scope variables. But, even though every user has their own session scope variables, your cfm pages still reference every user's session scope variables in the exact same way (using session.variableName).
For example: Using a line like <cfoutput>#session.username#</cfoutput> in a .cfm page will output the username of the current user that is running that page (assuming that session.username was set when they logged in). When another user comes to the exact same .cfm page and your system executes the exact same code (<cfoutput>#session.username#</cfoutput>), the second user's username will appear on the page.
That being said, a lock is simply to synchronize access to session variables so that multiple cfm files are not reading or writing to them at the same time (which can cause some unwanted results if they do). Reading/writing a session variable inside a named lock does not mean you're getting different session variables just because the lock name is different. In fact, you shouldn't even use a named lock to read/write session variables, you should use a scoped lock. For example, this would be the correct way to set the session variable "firstname" from a form submission:
Code:
<cflock scope="session" type="exclusive" timeout="10">
<cfset session.firstname = form.firstname>
</cflock>
And another example, this would be the correct way to read a session variable into a local (page) variable, and then display it:
Code:
<cflock scope="session" type="readonly" timeout="10">
<cfset user_first_name = session.firstname>
</cflock>
<cfoutput>#user_first_name#</cfoutput>
Anytime you set session variables, you should use an exclusive lock, and anytime you read session variables, you should use a readonly lock.
To get back to your question, the answer depends on if your applications are named differently or not. If you have an application.cfm file in application #1 that has <cfapplication name="app1" ... >, and an application.cfm file in application #2 that has <cfapplication name="app2" ... >, then the session variables for the
same user are actually different under each application.
This means, for a given user: In application #1, session.loggedIn could be set to true, but at the same time on application #2, session.loggedIn could be set to false. These variables are separate for the different applications and therefore they hold different values, even though they are referenced the exact same way by session.loggedIn. So, if the session timeout is set to 30 minutes, a user using application #1 could possibly be timed out of application #2 if they don't use application #2 within 30 minutes of their last use of it.
However, if both applications have the
same application name (ex: "app"), then the session scope is
shared between them. Therefore, if session.loggedIn is true initially, setting session.loggedIn to false on application #1 means that when when application #2 reads it, it will be false there as well.
I hope this explanation has helped you understand this concept better and has also answered your question. However, if it hasn't, post again and try to be as descriptive and specific as possible, and let me know if your application name's are the same or different.
Happy coding!