My application allows each user to checkout one item at a
time. This is enforced via session.item_ID, which can hold only one
item at a time. Is there a way a session can access item_ID of all
other concurrent sessions? Then I could make sure that a user
doesn’t checkout an item that a different user has already
This is not possible (by design), for security reasons.
Alternatively, you could keep a record of which item_id's are
currently "checked out" in the application scope. The application
scope is shared amongst all users on the server. Any time a user
checks out an item and adds it to their session, you could keep a
record of that in the application scope. ( I would probably store a
STRUCT that has item_ids as keys) Once the user releases the item
(or perhaps after a timeout period), you could remove that item
from the application scope.
If you're in a clustered CF environment, you'll probably need
to use a database table instead, but at a high level...using the
very same approach.