CUTCODEDOWN
Minimalist Semantic Markup

Welcome Guest
Please Login or Register

If you have registered but not recieved your activation e-mail in a reasonable amount of time, or have issues with using the registration form, please use our Contact Form for assistance. Include both your username and the e-mail you tried to register with.

Author Topic: Coding my own GDPR cookie code  (Read 437 times)

durangod

  • Sr. Member
  • ****
  • Posts: 407
  • Karma: +5/-0
  • Weebles Wobble - but they dont fall down!
Re: Coding my own GDPR cookie code
« Reply #15 on: 4 Dec 2023, 05:22:24 pm »

Thanks for the info on rem :)

That's as dumbass as using double-breaks for padding.

LOL so your saying thats wrong hee hee  i will never admit publically to doing that ever...    :P   Once in a great while i may find one of those left overs, but i have not done that in a long time.


Also I have no idea why you would have "four arrays" (of what exactly) or what that has to do with what should be ONE cookie?

In both cases though, your lack of using "escape" on the values is asking for headaches. If you're plugging a variable into a cookie string, escape it!

Its not one Cookie, each array is a seperate cookie, one is for login, one is for the GDPR and so on...  My project creates several different cookies for different reasons.   That is why i have to split them into arrays to read each one individually. 

I never thought of it that way with the secure cookie, but it makes perfect sense, if i am going to escape for the DB data when saving data,  i might as well use the same rule of escape for the secure cookie, thanks ill add that.    That is great tutoring.  :)  awesome!!


GrumpyYoungMan

  • Hero Member
  • *****
  • Posts: 788
  • Karma: +8/-0
    • Grumpy Young Man
Re: Coding my own GDPR cookie code
« Reply #16 on: 5 Dec 2023, 03:40:15 am »
Its not one Cookie, each array is a seperate cookie, one is for login, one is for the GDPR and so on...  My project creates several different cookies for different reasons.   That is why i have to split them into arrays to read each one individually. 
Can't you just save the extra data you want in the $_SESSION save the cookie(s) eating?
« Last Edit: 5 Dec 2023, 03:28:34 pm by GrumpyYoungMan »
Trying to learn a new trick to prove old dogs can learn new ones...

Total Novice have-a go Amateur Programmer - not sure that is the right thing to say... but trying to learn...

durangod

  • Sr. Member
  • ****
  • Posts: 407
  • Karma: +5/-0
  • Weebles Wobble - but they dont fall down!
Re: Coding my own GDPR cookie code
« Reply #17 on: 5 Dec 2023, 05:26:21 pm »
Can't you just save the extra data you want in the $_SESSION save the cookie(s) eating?


I love cookies too lol,  but cant do that with guests that i know of.

GrumpyYoungMan

  • Hero Member
  • *****
  • Posts: 788
  • Karma: +8/-0
    • Grumpy Young Man
Re: Coding my own GDPR cookie code
« Reply #18 on: 5 Dec 2023, 05:45:38 pm »
If you are generating a PHP session with then you can use the $_SESSION global array!

For your logged in users you could create a multi-level array using something like $_SESSION[‘user’] = [ ‘id’ = 1 ]
Trying to learn a new trick to prove old dogs can learn new ones...

Total Novice have-a go Amateur Programmer - not sure that is the right thing to say... but trying to learn...

durangod

  • Sr. Member
  • ****
  • Posts: 407
  • Karma: +5/-0
  • Weebles Wobble - but they dont fall down!
Re: Coding my own GDPR cookie code
« Reply #19 on: 5 Dec 2023, 10:34:54 pm »
Yes i already do that for logged in users.  The GDPR shows up before login so most visitors will click on it before logging in, some may not log in at all, they may just click on the GDPR and then leave the site if they lose interest.   The idea is to record a cookie via js on the userside when they visit and click on the button.   All it does is just keeps it from showing up again and expires in 10 days.    I actually like DS version of storing it in the DOM storage which is its purpose i think to just keep things stored  that otherwise dont mean anything lol

 

SMF spam blocked by CleanTalk

Advertisement