That is an expected behavior of the default vCLI scripts, you login, perform some operations, perhaps get some output and it logs out.
If you need to maintain a session to do bulk updates, then you would need to create a customized script that basically login and does operation X,Y,Z before logging out, else any of the scripts you run, is generally done on a per host basis unless you login to vCenter and perform bulk operations against X number of ESX(i) hosts.
If you could further elaborate what you're trying to accomplish, it might help us give guide you. In general, if you're performing operations against hosts themsevles, the best way is to write a quick for loop and execute vCLI scripts and pass in either .viperlconfig or specify the credentials to be passed in.
=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at:
Twitter: @lamw
VMware Code Central - Scripts/Sample code for Developers and Administrators
VMware Developer Community
If you find this information useful, please award points for "correct" or "helpful".