the store order summary or store order details behaviors on the confirm page are storing the session ID value in a column that is numeric
Most likely it is in the Store order summary behavior.
Double check the store order summary behavior for the column that is bound to the session ID. Make sure the data type is set to text.
you will also need to update that column in the database to make it a text column.