Tutorials

Remove session contents

Sometimes, you need to remove just part of a session variables content, rather than destroying the whole session.

Here's how you do it in ASP and ColdFusion.

ASP
<% Session.Contents.Remove("MyVariable") %>

ColdFusion
<CFSET StructDelete(SESSION, "MyVariable")>

Notes

With thanks to Peter Bagnato for posting the ColdFusion solution to the macromedia.ultradev forum.