The following rules apply to ending a session and deleting Session scope variables:
<cfset StructClear(Session)>
cflogout tag to log users out.
<cfset getPageContext().getSession().invalidate()>
This line creates a pointer to the servlet page context and calls an internal method to reset the session. This clears all session information, including the session ID Session scope variables, and if you are using session login storage, the login information, for future request. However, the session information does remain available until the end of the current request. After you invalidate a session, attempts by the browser to access the application will generate an invalid session exception until the session times out.
Note: You cannot destroy the session and create a session on the same request, as creating a new session involves sending session cookies back.
ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | KnowledgeBase | Bug Reporting
Version 7
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/coldfusion/7/htmldocs/00001163.htm
Comments
Kronin555 said on Oct 14, 2005 at 7:53 AM : ASandstrom said on Oct 14, 2005 at 11:08 AM : mm_202 said on Feb 3, 2006 at 8:19 AM : No screen name said on Jul 24, 2006 at 12:28 PM : No screen name said on Jan 17, 2007 at 1:17 PM :