The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CookieHelper.cs 605B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Teknik.Utilities
  5. {
  6. public static class CookieHelper
  7. {
  8. public static string GenerateCookieDomain(string domain, bool local, bool dev)
  9. {
  10. if (local) // localhost
  11. {
  12. return null;
  13. }
  14. else if (dev) // dev.example.com
  15. {
  16. return string.Format("dev.{0}", domain);
  17. }
  18. else // A production instance
  19. {
  20. return string.Format(".{0}", domain);
  21. }
  22. }
  23. }
  24. }