Separate sessionid creation in two different functions