2 Replies Latest reply on Feb 12, 2008 6:29 AM by wolfv

    session variables

    wolfv
      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 checked out.

      Thank you.
        • 1. Re: session variables
          Grizzly9279 Level 1
          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.
          • 2. Re: session variables
            wolfv Level 1
            Thanks Grizzly. The design for security makes sense. I will implement item checkout in database as you suggested. And I thought I had discovered an easier way :-)