Reputation: 1827
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.
Upvotes: 0
Views: 236
Reputation: 1866
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.
Upvotes: 2