I would like to identify admin users and non-admin (but logged in) users through cookies. I need this feature because I use Hyper Cache (which uses cookies to identify those who send pages in cache): I would like to serve cached page to all users not logged in and to all users logged in but non-admin. The logged in admin users will not get cached pages.
|
You can use
This is an extremely basic example. There are a lot of details to cookie management so you may want to do a bit of reading up on cookie paths, domains and expiration. You also may do better to simply set the cookie with the appropriate hook instead of relying on the user capabilities with the
|
|||
|
|
|
You can achieve this by
Please be sure to check if only the administrators have the capability to If |
|||||
|