Fixes PreserveKey not being passed from a redirect (#522) #526
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a duplicate pull request of pull 523 but because I reset my local develop repo, it removed the commit and closed the original pull request. The price I pay for not creating a specific issue branch originally. Sorry about that.
Copied original pull details here...
Issue:
In Lucee,
localmode="modern"
is extremely strict with what scopes are referenced/available in the chain. Especially when a function within a function accepts a closure. This makes external local and variables scopes unavailable unless directly passed and returned for further use.Fix:
The committed fix sets
localmode="classic"
in the function expression passed intosessionLock()
inside ofgetNextPreserveKeyAndPurgeOld()
. This allows FW/1's flash context to work as expected, regardless of the number of contexts, in both Lucee and Adobe ColdFusion (since the attribute is simply ignored).Note On Alternative Approaches:
If it's preferred to avoid engine specific mechanics in the code, an alternative approach is to define both the "next" and "old" keys to session variables that are accessible to all levels of the execution chain in
getNextPreserveKeyAndPurgeOld()
.