Do I need a Cookie consent on a basic WordPress site?

IMHO, If your site stores cookies on the visitor’s local computer, or if it captures any personal information (newsletter signup, contact forms that ask for name/email), or if the hosting place captures requests in a log, then you need GDPR compliance. Of if you use any analytics information, as in Google Analytics You can look … Read more

wordpress can’t read a cookie?

Solved : WP Engine :rolleyes – When using WPEngine you have to ask them to manually exempt whatever cookies you set otherwise the caching they use will essentially render an empty string and make it look like the cookie wasn’t set

How to change WordPress cookies to be session-only

The wp_generate_auth_cookie() function is a pluggable function, meaning you can define a function with the same name in a plugin and your version will be used instead of the WordPress core function. The number of pluggable functions is limited, however. If you want a broad solution that works for all cookies, your lower-level Lua approach … Read more

WordPress Post Voting – Vote once per IP on entire site

The only difference you need is the place where the IP address will be stored. Instead of a post meta use an option. So, where the script says … $voter_ips = get_post_meta($postid, “voter_ips”, true); … use … $voter_ips = get_option( “wpse_59080_voter_ips”, true ); … and where it updates a post meta you should update the … Read more

Set Short Automatic Logout Time for One User

One approach can be to log the time a user is logging in at by using: function user_last_login($user_login, $user) { update_user_meta($user – > ID, ‘last_login’, time()); } add_action(‘wp_login’, ‘user_last_login’, 10, 2); and then checking if the time is passed: add_action(‘get_header’, ‘processOnPageLoad’, 1 ); add_action(‘admin_init’, ‘processOnPageLoad’, 1 ); function processOnPageLoad() { if( is_user_logged_in() && condition_to_check_required_user ) … Read more

Store value in cookie

Use setcookie() like shown below: setcookie( $name, $value, time() + 3600, COOKIEPATH, COOKIE_DOMAIN ); Note: $wpdb->insert_id AFAIK will always return false or 1, so I’m not sure if that will be of value for your. I might be wrong about that see @s_ha_dum’s comment.

Setting cookies in WP REST API requests

Adding this line to my $.ajax call fixed the problem for me. $.ajax({ xhrFields: { withCredentials: true }, // the rest… Sidenote: this requires the following header to be set on the server-side, which is enabled by default with the REST API (it seems). Access-Control-Allow-Credentials:true

Passing cookies when using wp_remote_get

The arguments array for wp_remote_get accepts a cookies parameter: $cookies = []; $cookie = new WP_Http_Cookie( ‘cookie_name’ ); $cookie->name=”cookie_name”; $cookie->value=”your cookie value”; $cookie->expires = 7 * DAY_IN_SECONDS; // expires in 7 days $cookie->path=”https://wordpress.stackexchange.com/”; $cookie->domain = ‘.reddit.com’; $cookies[] = $cookie; $url=”https://tumblr.com/some/url/”; $args = [ ‘cookies’ => $cookies, ]; $response = wp_remote_get( $url, $args );

Is it possible to use cookie-free domains in WordPress?

Earlier it wasn’t possible to use cookie-free domain while using Cloudflare CDN/ Proxy to be exact. Well until yesterday. Cloudflare rolling a new update where they are retiring _cfduid cookie, so your best option will be to wait a few weeks. More details on this- https://blog.cloudflare.com/welcome-to-privacy-and-compliance-week/#improving-the-privacy-of-our-service

techhipbettruvabetnorabahisbahis forumutaraftarium24eduseduseduedueduseduseduseduseduedus