Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is structClear(session) different than sessionInvalidate()?

Tags:

coldfusion

This might be a silly question but I'd like to know what exactly is the difference between structClear(session) and the sessionInvalidate() function added in ColdFusion 10?

like image 417
Pritesh Patel Avatar asked Aug 06 '26 22:08

Pritesh Patel


1 Answers

According to Mister Dai, who has backported the SessionInvalidate function to previous versions, it performs more than just calling StructClear, and also calls onSessionEnd before this, and coldfusion.runtime.sessionTracker.cleanup afterwards.

Further details at: https://misterdai.yougeezer.co.uk/blog/project/2012-03-12/


Something that _neither_ of these methods do, which is worth being aware of, is that they do not invalidate the session if CF is set to "Use J2EE session variables" (since this is controlled by the underlying servlet engine, not by CF)
like image 135
Peter Boughton Avatar answered Aug 09 '26 05:08

Peter Boughton