Quote:
Originally Posted by eyal282
Why do you use Private cookies when it clearly looks like you're trying to make the cookie available for all? Why not Public cookie?
|
https://sm.alliedmods.net/new-api/cl...s/CookieAccess
This selection configures whether the user can change the cookie value manually, or whether they can even see the current value via
sm_cookies.
CookieAccess_Public means that the user can insert any string into the cookie by using sm_cookies.
CookieAccess_Restricted means that the user can use sm_cookies to view the raw value of the cookie as stored in the database, but cannot change it.
CookieAccess_Private means that the cookie will not show up in the sm_cookies list, and cannot be viewed or changed. The value of the cookie is instead exclusively changed through other means, such as a menu or something.
The vast majority of cookies will be private. There is almost no reason to do anything else. Any cookie that takes a user-defined string would probably be better off having a separate, dedicated command to changing it and reading it. I really can't think of any valid reason to use anything other than CookieAccess_Private.
__________________