RE: Remove all session keys except one

From: David Coe, MCP (anonymous_at_discussions.microsoft.com)
Date: 06/01/04


Date: Tue, 1 Jun 2004 12:46:09 -0700

You could also set the session variable to a temporary value, clear the session, then reset it, such as:

object returnPath = Session["ReturnPath"]

Session.Clear()
Session.Abandon()

Session["ReturnPath"] = returnPath;