Selenium is meant to replicate real user behavior. So if the session does terminate on navigating away from APP 1 when a real user would do it, then the exact same behavior is seen when running these steps via selenium webdriver.
If you still wish to do i, it can be done this way -
@driver1 = Selenium::WebDriver.for(:remote, :url => @sel_grid_url, :desired_capabilities => @browser) #create a browser session controlled by driver1
@driver2 = Selenium::WebDriver.for(:remote, :url => @sel_grid_url, :desired_capabilities => @browser) #create another browser session controlled by driver2
@driver1.get "http://#{app1}/"
## user x tries to log in, but has no account and the login fails
@driver2.get "http://#{app2}"
## a user for App 1 is created
.
.
.
The above code is in Ruby, and has been implemented with Selenium Grid 2 is the middle.