Currently there is no official implementation of a Session State which would allow you to maintain variables across several runs (needed for a counter like you said).
There are, however, small workarounds which work until an official method is implemented.
You can check them out here and here.