Cookie Or Http Headers In Case Of Logged In Users

Is there way to identify any cookie or http header if a user is logged in and or has added items to their cart?

I am trying to optimize the way Nginx's micro-caching is working.

Thanks in advance