({{, (RefLink[$CurrentWebSession, paclet:ref/$CurrentWebSession]) 
gives the currently active web session used by (RefLink[WebExecute, paclet:ref/WebExecute]).}})

OpenersNotesSection(Spacer1)Details

(RefLink[$CurrentWebSession, paclet:ref/$CurrentWebSession]) is set to the (RefLink[WebSessionObject, paclet:ref/WebSessionObject]) created by (RefLink[StartWebSession, paclet:ref/StartWebSession]).

(RefLink[WebExecute, paclet:ref/WebExecute]) uses (RefLink[$CurrentWebSession, paclet:ref/$CurrentWebSession]) when no (RefLink[WebSessionObject, paclet:ref/WebSessionObject]) is provided.

When the session corresponding to (RefLink[$CurrentWebSession, paclet:ref/$CurrentWebSession]) is closed with (RefLink[DeleteObject, paclet:ref/DeleteObject]), (RefLink[$CurrentWebSession, paclet:ref/$CurrentWebSession]) is set to (RefLink[None, paclet:ref/None]).

(RefLink[$CurrentWebSession, paclet:ref/$CurrentWebSession]) can be set to any active (RefLink[WebSessionObject, paclet:ref/WebSessionObject]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

(RefLink[$CurrentWebSession, paclet:ref/$CurrentWebSession]) is (RefLink[None, paclet:ref/None]) initially:

$CurrentWebSession

Start a new web session:

session=StartWebSession["Chrome"]

(RefLink[$CurrentWebSession, paclet:ref/$CurrentWebSession]) is the most recently started (RefLink[WebSessionObject, paclet:ref/WebSessionObject]):

$CurrentWebSession

(RefLink[WebExecute, paclet:ref/WebExecute]) uses (RefLink[$CurrentWebSession, paclet:ref/$CurrentWebSession]) when no other (RefLink[WebSessionObject, paclet:ref/WebSessionObject]) is given:

WebExecute["OpenWebPage"->"https://www.wolfram.com"]

Close the web session:

DeleteObject[session]

(RefLink[$CurrentWebSession, paclet:ref/$CurrentWebSession]) is (RefLink[None, paclet:ref/None]) again:

$CurrentWebSession

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[WebSessionObject, paclet:ref/WebSessionObject])  ▪  (RefLink[StartWebSession, paclet:ref/StartWebSession])  ▪  (RefLink[WebExecute, paclet:ref/WebExecute])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Web Browser Automation, paclet:guide/WebBrowserAutomation])}, {▪(RefLinkPlain[HTTP Requests & Responses, paclet:guide/HTTPRequestsAndResponses])}})}})