Modified to allow overwriting session variable name.