Q:

How to create a new watson assistant session on exisiting session expiration in Flask?

I am using watson assistant with flask framework. Once the session expires i get the following error 
ApiException(response.status_code, error_message, http_response=response)
ibm_cloud_sdk_core.api_exception.ApiException: Error: NotFound: session id ba62bf14-87e-4c7b071b591e for agent instance 0e5c653c-9-b4e0-5a597c3e541e, Code: 404 , X-global-transaction-id: ffea409d54977b49
127.0.0.1 - - [03/Jul/2019 11:27:47] "GET / HTTP/1.1" 200
Refreshing the page does not create a new session 
How to create a new session on this exception, so that I need not restart the  local server ?

A:

You mention a 5 minute session timeout. 
Watson Plus trial has this set for just testing, and is not intended to be production level. It cannot be changed. 
Standard version and lite can use session but both were originally stateless. You should use the V1 API for these. You will have to manage the state, but you will no longer have a time out.
If you are using the paid version of Watson Plus, or premium you can change the time out within the assistant settings. 

