I am tracking special user interactions with each question (not the default q2a actions like answer, comment etc.). This data gets saved in a separate db table which also holds cookieid and userid so that I can identify the user.
The widgets display previous interactions with those questions to the user, and need to identify him.
I solved it now by calling a layer, overriding doctype, and setting the cookie there if !isset($userid). Then in the widgets I only use qa_cookie_get(); which seems to work.