Setting custom value in server side cookie

Hi,
How do I set a custom value as the server-side cookie value (e.g. network_user_id + a value retrieved from my server/db)?

You could do this by modifying the function that builds the cookie headers within the collector here.