Nette\Web\Session does not write changes that I make to SessionNamespaces while processing AJAX request. session_write_close() is obviously not called. When I call it manually after making some changes to the session, it works. More info at http://forum.nette.org/cs/4519-ajax-request-a-zmeny-v-session in czech language.