gsr
12/05/2022, 2:43 PMViral
12/05/2022, 2:54 PM<cfdump var="#isDefined("session.original")#">gsr
12/05/2022, 3:07 PMgsr
12/05/2022, 3:10 PM<cfset session.original = 1>
<cfloop collection="#session#" item="i">
<cfif left(i, 8) is 'original'>
<cfset i['sessionRotated'] = structCount(i.original)>
<cfset i['original'] = ''>
</cfif>
<cfset SetVariable("ix.session.#i#",duplicate(session[i]))>
</cfloop>
<cfdump var="#ix#">slcronin
12/05/2022, 3:11 PMgsr
12/05/2022, 3:18 PMslcronin
12/05/2022, 3:23 PMgsr
12/05/2022, 3:33 PMMichael Schmidt
12/05/2022, 4:01 PMgsr
12/05/2022, 4:06 PMViral
12/05/2022, 4:20 PMhow many times it happened
WhatMichael Schmidt
12/05/2022, 4:22 PMgsr
12/05/2022, 4:38 PM<cfset session.original = { 'id' = 1}>
<cfloop collection="#session#" item="i">
<cfif StructKeyExists(i,'original') and isStruct(i.original)>
<cfset i.sessionRotated = structCount(i.original)>
<cfset i.original = {}>
</cfif>
<cfset SetVariable("id.session.#i#",duplicate(session[i]))>
</cfloop>
<cfdump var="#id.session#">gsr
12/05/2022, 4:38 PMgsr
12/05/2022, 4:41 PMslcronin
12/05/2022, 4:42 PMMichael Schmidt
12/05/2022, 4:42 PMMichael Schmidt
12/05/2022, 4:44 PMgsr
12/05/2022, 5:04 PMgsr
12/05/2022, 5:05 PMMichael Schmidt
12/05/2022, 5:05 PMAdam Cameron
Adam Cameron
Adam Cameron
i when it didn't work how you expected it, you'd likely have worked it out for yourself.gsr
12/05/2022, 5:06 PMAdam Cameron
gsr
12/05/2022, 5:06 PMgsr
12/05/2022, 5:06 PMAdam Cameron
Michael Schmidt
12/05/2022, 5:07 PMgsr
12/05/2022, 5:07 PMAdam Cameron
Adam Cameron
this is too annoying
i did a dump of <cfdump var="#isStruct(i)#"> inside a loop and its going as falseThat is literally asking other ppl to do your work for you.
gsr
12/05/2022, 5:09 PMgsr
12/05/2022, 5:09 PMAdam Cameron
Adam Cameron
<cfloop>... and check the value of i. What does that tell you?Adam Cameron
isStruct(i) is returning false. Why might it do that? First step: "well if it's not a struct... what is it?" Go check.
Troubleshooting.
This is what we all do all day every day.Michael Schmidt
12/05/2022, 5:11 PMgsr
12/06/2022, 1:52 AMAdam Cameron
isStruct(i) is false? Why? What's the value of i if it's not a struct? Once you have that value, you can reason as to why it's that value. Simple troubleshooting.
Your overall issue I think is that you are relying on asking other people to help you too early in the troubleshooting cycle. As soon as something isn't working how you expect it to: you ask here (or: this is how it seems). That is too soon. Troubleshoot first. Make sure you know what the code you are using is supposed to do (ie: read the docs / refresh your memory / whatever). When code is not doing what you expect... inspect the values. You need to do all this sort of thing before escalating it to other people.
This is not me being a meany. This is me observing what the baseline of troubleshooting is, which is fundamental to our jobs.slcronin
12/06/2022, 3:27 PMgsr
12/07/2022, 4:37 PMslcronin
12/07/2022, 5:20 PM