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

session variables

Guest
Feb 11, 2008 Feb 11, 2008

Copy link to clipboard

Copied

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.
TOPICS
Advanced techniques

Views

226

Translate

Translate

Report

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

correct answers 1 Correct answer

Engaged , Feb 12, 2008 Feb 12, 2008
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 rem...

Votes

Translate

Translate
Engaged ,
Feb 12, 2008 Feb 12, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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
Feb 12, 2008 Feb 12, 2008

Copy link to clipboard

Copied

LATEST
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 🙂

Votes

Translate

Translate

Report

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
Documentation