The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

CookieHelper.cs 647B

12345678910111213141516171819202122232425262728
  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 DEBUG
  11. return null;
  12. #endif
  13. if (local) // localhost
  14. {
  15. return null;
  16. }
  17. else if (dev) // dev.example.com
  18. {
  19. return string.Format("dev.{0}", domain);
  20. }
  21. else // A production instance
  22. {
  23. return string.Format(".{0}", domain);
  24. }
  25. }
  26. }
  27. }