Setting a cookie across domains


SUBMITTED BY: Guest

DATE: Oct. 30, 2019, 5:37 p.m.

FORMAT: Text only

SIZE: 2.0 kB

HITS: 353

  1. Setting a cookie across domains
  2. Since 3rd party cookies are going the way of Friendster, my plans are gonna have to change :-(
  3. ++++++++++++++
  4. list of top cheapest host http://Listfreetop.pw
  5. Top 200 best traffic exchange sites http://Listfreetop.pw/surf
  6. free link exchange sites list http://Listfreetop.pw/links
  7. list of top ptc sites
  8. list of top ptp sites
  9. Listfreetop.pw
  10. Listfreetop.pw
  11. +++++++++++++++
  12. I have about 60 domains parked on top of the main domain, and I show different content based on the domain. But I was planning to start diverting at least all mobile users from the parked domain to the main domain, with the theory that a single domain with 15 million monthly pageviews might be worth more to Adsense than 60 domains with the same traffic spread out.
  13. Since the users can log in to each domain separately, I was adding a bit of Javascript to the footer of each page to set a logged-in cookie on the main domain:
  14. // getCookie() and setCookie() are separate functions I've been using for years)
  15. // on the parked domain
  16. <script>
  17. var username = getCookie('username');
  18. </script>
  19. <script src='https://www.example.com/login.js'></script>
  20. // login.js on the main domain
  21. if (!getCookie('username')
  22. // cookie_name, cookie_value, days before expiration
  23. setCookie('username', username, 365);
  24. But I guess that this isn't going to work, now that 3rd party cookies are being blocked?
  25. So can you guys and gals suggest another way that I might log the user in across domains? I can work with PHP or Javascript, and I'm using Apache if it matters.
  26. You can use JWT tokens in place of cookies. This is typically used for REST api's or similar applications, but it may work for you. It's worth a look, but it is rather technical.
  27. wordlinx.com
  28. hosting providers
  29. 1 hosting
  30. le domaine
  31. t-systems hosting services
  32. hosting dude
  33. hosting o alojamiento web
  34. evitahost.com
  35. 5 hosting
  36. hosting 1 tahun
  37. www.dailytalkadz.com

comments powered by Disqus