Raised This Month: $32 Target: $400
 8% 

Remove/Clear Client Cookies?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pcmaster
AlliedModders Donor
Join Date: Sep 2009
Old 01-28-2013 , 14:33   Remove/Clear Client Cookies?
Reply With Quote #1

Hello,

as I am currently coding a Plugin that uses Clientprefs/Cookies, I am looking for a way to clear all Cookies from that Plugin, for example with a Command.

I have already searched the Documentation & Google, but I can't find a Native to remove them.
Has anyone got Ideas?
__________________
Stopped hosting servers as of November 2018, no longer active around here.
pcmaster is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 01-28-2013 , 14:49   Re: Remove/Clear Client Cookies?
Reply With Quote #2

delete clientprefs-sqlite.sq3 in sourcemod/data folder
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
pcmaster
AlliedModders Donor
Join Date: Sep 2009
Old 01-28-2013 , 15:03   Re: Remove/Clear Client Cookies?
Reply With Quote #3

I could do that, but the Problem is I only want to delete the Cookies from one specified Plugin.
Deleting the file removes ALL Cookies from ALL Plugins.
__________________
Stopped hosting servers as of November 2018, no longer active around here.
pcmaster is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 01-28-2013 , 15:11   Re: Remove/Clear Client Cookies?
Reply With Quote #4

Quote:
Originally Posted by pcmaster View Post
Deleting the file removes ALL Cookies from ALL Plugins.
Correct. Why you afraid of doing that?
You could also remove cookies from all clients using this program... Just realize you need to remove separate cookie for all steamid's that was connected to a server when this plugin was enabled. This may spend alot of time!
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
Bimbo1
Senior Member
Join Date: Jan 2010
Location: brazil
Old 01-29-2013 , 00:56   Re: Remove/Clear Client Cookies?
Reply With Quote #5

if you don't want to delete the cookies using a sqlite browser, you could just change the RegClientCookie and create another id. for example, change this:
Code:
cookiezi = RegClientCookie("cookiezi", "yummy cookies", CookieAccess_Private);
to this:
Code:
cookiezi = RegClientCookie("cookiezi2", "yummy cookies 2", CookieAccess_Private);
it would just start over a new id with cleared cookies for the clients.

Last edited by Bimbo1; 01-29-2013 at 00:58. Reason: it was missing a "s"
Bimbo1 is offline
Merudo
Senior Member
Join Date: Feb 2016
Old 04-07-2016 , 21:06   Re: Remove/Clear Client Cookies?
Reply With Quote #6

Having a way to delete all cookies with a specific name would be extremely useful. Is there a way it could be added to sourcemod in a new version?
__________________

Last edited by Merudo; 04-07-2016 at 21:06.
Merudo is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 04-07-2016 , 21:15   Re: Remove/Clear Client Cookies?
Reply With Quote #7

Quote:
Originally Posted by Merudo View Post
Having a way to delete all cookies with a specific name would be extremely useful. Is there a way it could be added to sourcemod in a new version?
more specifically, the clientprefs extension.

Last edited by WildCard65; 04-07-2016 at 21:15.
WildCard65 is offline
Merudo
Senior Member
Join Date: Feb 2016
Old 04-08-2016 , 02:17   Re: Remove/Clear Client Cookies?
Reply With Quote #8

Yeah, I want to hold a cookie that only lasts a round. That cookie would hold information about a client that should be kept even if the client connects / disconnects.

Since cookies can not be cleared at the end of a round, I'm just holding the information in a character array instead, and clearing that up at the end of each round.
__________________

Last edited by Merudo; 04-08-2016 at 02:17.
Merudo is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 04-08-2016 , 02:26   Re: Remove/Clear Client Cookies?
Reply With Quote #9

You shouldn't be using the cookie system for that purpose anyway. The cookie system actually writes to disk, so it's meant for information that should persist even across server restarts. It's woefully inefficient for anything else. (And some of the Sourcemod devs have even gone as far as to say that the clientprefs system shouldn't be used for things that aren't client preferences.) It's much more efficient to just keep that information in RAM.

Merudo, I'm thinking that your best bet would be a string map (if this isn't what you're already using). A rough example of the relevant code can be seen below. Untested. I've also never used a stringmap before soooo...

Spoiler


But yeah, a Sourcemod-supplied way to clean up the clientprefs database would be nice.
__________________

Last edited by ddhoward; 04-08-2016 at 03:03.
ddhoward is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-08-2016 , 04:02   Re: Remove/Clear Client Cookies?
Reply With Quote #10

@ddhoward +1

...use global variables to store settings for short temporary time, on plugin life time.
__________________
Do not Private Message @me
Bacardi is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode