Added newsession support in the extension.

This is one of few functions that need special support, since the returned sessionid needs to be passed back.