Thanks a lot Maxim!
I've changed
(^|[;,])jetbrains\.charisma\.main\.security\.PRINCIPAL=([^;,]+)($|[;,])
to
(.*)jetbrains\.charisma\.main\.security\.PRINCIPAL=([^;,]+)($|[;,])
because your regexp didn't matched my cookie and now everything is working.
How cpu expensive these calculations ? Should I try to patch Nginx to allow dot's in cookie name or I can use this solution without any overhead ?
Thanks,
Sergey