Instead of going to the web.config file you can use this little script to change your enableSessionState.
function Set-enableSessionState{
param([string]$path = $(read-host "Please enter a web.config file to read"),
[string]$value = $(read-host "Set Session State : 'true' or 'false'"))
$date = (Get-Date).tostring("mm_dd_yyyy-hh_mm_s");
$backup = $path + "_$date";
$xml = [xml](Get-Content $path);
$xml.Save($backup);
$root = $xml.get_documentElement();
$sysweb = $root["system.web"];
$sysweb.pages.SetAttribute("enableSessionState",$value);
$xml.Save($path);
}
Use:
Set-enableSessionState "C:\inetpub\wwwroot\wss\VirtualDirectories\91\web.config" "true"