examples: fix bug in a session example

fixes #1054