While using Coldfusion session (not J2EE) , <cfset StructClear(Session)> does not ends a session,It deletes the CFID,CFTOKEN and SESSIONID but does not deletes the URLTOKEN.
In the subsequent request, it does not starts a new SESSION and keep maintaining the old session.
(Explain in: http://www.bennadel.com/blog/1846-Clearing-The-Session-Scope-Does-Not-End-Your-ColdFusion-Session.htm)
My question is, Now without CFID and CFTOKEN in SESSION scope How Coldfusion maintains the SESSION?
As previously I was thinking each time ColdFusion server checks the cfid and cftoken sent in the request header with the cfid and cftoken present in session scope to maintain the session.But I think i am wrong because without cfid and cftoken in the session scope also Coldfusion continues to maintain SESSION.
So How ColdFusion manage a SESSION internally, I mean how it decide to continue with a old session or to create a new one?
SessionInvalidate()function. It will clear the session scope and invalidate the CFID,CFTOKEN values on the server. However, keep in mind it will not work if you are using J2EE sessions.sessionInvalidate()works fine as it calls theonSessionEnd()to end a session.