wp_cookie_constants

Defines cookie related WordPress constants.

Description

wp_cookie_constants(); 

Defines constants after multisite is loaded.


Usage

  1. if ( !function_exists( 'wp_cookie_constants' ) ) { 
  2. require_once ABSPATH . WPINC . '/default-constants.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_cookie_constants(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/default-constants.php  
  1. function wp_cookie_constants() { 
  2. /** 
  3. * Used to guarantee unique hash cookies 
  4. * @since 1.5.0 
  5. */ 
  6. if ( !defined( 'COOKIEHASH' ) ) { 
  7. $siteurl = get_site_option( 'siteurl' ); 
  8. if ( $siteurl ) 
  9. define( 'COOKIEHASH', md5( $siteurl ) ); 
  10. else 
  11. define( 'COOKIEHASH', '' ); 
  12.  
  13. /** 
  14. * @since 2.0.0 
  15. */ 
  16. if ( !defined('USER_COOKIE') ) 
  17. define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH); 
  18.  
  19. /** 
  20. * @since 2.0.0 
  21. */ 
  22. if ( !defined('PASS_COOKIE') ) 
  23. define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH); 
  24.  
  25. /** 
  26. * @since 2.5.0 
  27. */ 
  28. if ( !defined('AUTH_COOKIE') ) 
  29. define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH); 
  30.  
  31. /** 
  32. * @since 2.6.0 
  33. */ 
  34. if ( !defined('SECURE_AUTH_COOKIE') ) 
  35. define('SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH); 
  36.  
  37. /** 
  38. * @since 2.6.0 
  39. */ 
  40. if ( !defined('LOGGED_IN_COOKIE') ) 
  41. define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH); 
  42.  
  43. /** 
  44. * @since 2.3.0 
  45. */ 
  46. if ( !defined('TEST_COOKIE') ) 
  47. define('TEST_COOKIE', 'wordpress_test_cookie'); 
  48.  
  49. /** 
  50. * @since 1.2.0 
  51. */ 
  52. if ( !defined('COOKIEPATH') ) 
  53. define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) ); 
  54.  
  55. /** 
  56. * @since 1.5.0 
  57. */ 
  58. if ( !defined('SITECOOKIEPATH') ) 
  59. define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) ); 
  60.  
  61. /** 
  62. * @since 2.6.0 
  63. */ 
  64. if ( !defined('ADMIN_COOKIE_PATH') ) 
  65. define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); 
  66.  
  67. /** 
  68. * @since 2.6.0 
  69. */ 
  70. if ( !defined('PLUGINS_COOKIE_PATH') ) 
  71. define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL) ); 
  72.  
  73. /** 
  74. * @since 2.0.0 
  75. */ 
  76. if ( !defined('COOKIE_DOMAIN') ) 
  77. define('COOKIE_DOMAIN', false);