PDA

View Full Version : Can client access their cookies by themselve?


LambdaLambda
10-13-2014, 13:08
security thing question:

are players somehow able to access their cookies, edit them? Reason why I'm asking is, I would like to store some data in client's cookies so I would not have to loop queries over and over with timer, but call it on player's disconnect. However, so in case of server crash or any other event that could not record player's leaving - to import them into db on his connect.

VoiDeD
10-13-2014, 13:27
enum CookieAccess
{
CookieAccess_Public, /**< Visible and Changeable by users */
CookieAccess_Protected, /**< Read only to users */
CookieAccess_Private, /**< Completely hidden cookie */
};


Keep in mind that once you've created a cookie, you can't change the access level without creating a completely new cookie with a different name (at least without editing the sqlite database).

LambdaLambda
10-13-2014, 13:49
Thank you, however I knew about these attributes. But I rather ask about how it looks in practice, not theory. So may I be calm, so player for sure won't be able to modify it, right?

Mitchell
10-13-2014, 14:29
Are you talking about the command "sm_cookies" ?

psychonic
10-13-2014, 14:49
Thank you, however I knew about these attributes. But I rather ask about how it looks in practice, not theory. So may I be calm, so player for sure won't be able to modify it, right?
It works exactly as documented.

With regard to clients being able to access their cookie:
CookieAccess_Public - Client can read and modify the value directly.
CookieAccess_Protected - Client can read the value, but not modify it directly.
CookieAccess_Private - Clients have no direct access to the value.

LambdaLambda
10-14-2014, 12:03
Thank you then!