0

We are noticing a number of issues relating to our website for shopping cart data.

As the cart data is stored in the user's session, I'm wondering whether it's possible to open a specific session from a script and dump out the output if we have the session ID?

It would be useful to know so we can see what is specifically in a user's session that may be causing the issues to occur.

1 Answer 1

2

Yes you can:

<cfscript> app = 'YOUR_APPLICATION_NAME'; sessiontracker = createObject("java","coldfusion.runtime.SessionTracker"); sessionCollection = sessionTracker.getSessionCollection(app); structEach(sessionCollection, function(k,v){ writeDump(sessionCollection[k]); }); </cfscript> 

This script basically lists all the session objects for a given application on your server. You can change it to your needs to find out the relevant session based on the keys you put in your session.

thisSession = sessionCollection[k]; //loop through thisSession keys 

I do not have a working CF box with me now to test this to perfection; but I believe you will be in the right direction.

Sign up to request clarification or add additional context in comments.

2 Comments

<cfdump var="#session#"> is a lot simpler.
Dan, the OP asked about getting session info from another session, not the current one.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.