Skip to content

Works with your stack

Cookie consent on a LiteSpeed server

country set by the server

← Cookie Rocks for your stack

OpenLiteSpeed and LiteSpeed Web Server can look up the visitor’s country themselves and give it to PHP. Cookie Rocks Pro can use that value for rules by country. The LiteSpeed Cache plugin has its own page.

By LiteSpeed Technologies · litespeedtech.com

Is this your product? Tell us if anything here is out of date. Write to us

What matters for consent with LiteSpeed server

The country comes from the server

With IP geolocation on, OpenLiteSpeed gives PHP GEOIP_COUNTRY_CODE as two capital letters, for IPv4 and IPv6. Private or unknown addresses get no value.

The region depends on the database

With GeoLite2-City, GEOIP_REGION holds the subdivision code, such as CA or TX in the United States. With the free DB-IP City Lite database there is no region code.

A visitor cannot write it

A GEOIP-Country-Code or GEOIP-Region header sent by the visitor arrives as HTTP_GEOIP_COUNTRY_CODE or HTTP_GEOIP_REGION and never changes the server’s own values.

What our tests found on LiteSpeed server

  • Good to know · OpenLiteSpeedOpenLiteSpeed GeoIP gives no region code with DB-IP Lite

    With enableIpGeo and a geoipdb block (geoipDBName CITY_DB), OpenLiteSpeed gives PHP GEOIP_COUNTRY_CODE as two capital letters (IPv4 and IPv6), plus GEOIP_COUNTRY_NAME, GEOIP_REGION_NAME and GEOIP_CITY. With the free DB-IP City Lite database, GEOIP_REGION is missing, because that database has no subdivision code. Private or unknown addresses get no variables. A visitor's GEOIP-Country-Code request header becomes HTTP_GEOIP_COUNTRY_CODE and never overwrites GEOIP_COUNTRY_CODE. An ipToGeo block in the config file is ignored without any message.

    Seen in our tests, 25 October 2026, OpenLiteSpeed 1.9.3. Source

  • Good to know · OpenLiteSpeedOpenLiteSpeed gives the region code with GeoLite2-City

    With the GeoLite2-City database (geoipDBName CITY_DB), OpenLiteSpeed gives PHP GEOIP_REGION as the subdivision code without the country, such as CA or TX in the United States (three letters in some countries). An address without a subdivision in the database gives the country only. A visitor's GEOIP-Region request header becomes HTTP_GEOIP_REGION and does not change GEOIP_REGION.

    Seen in our tests, 25 October 2026, OpenLiteSpeed 1.9.3. Source

Questions

Does the server’s page cache change the banner?

No. The page is the same for everyone and the country is asked for from an address that is never cached.

What happens after the 30-day trial?

The banner, your visitors’ choices and your proofs of consent keep working. Without a key, most settings lock, updates and support stop. Take a key at any time and everything opens again.

For LiteSpeed servers

The server knows the country, the banner follows.

country by country

Rules by country are part of the complete plugin. Every feature of the complete plugin for 30 days, no card.

  • During the trial: everything, including the full settings and the scans
  • After 30 days without a key: the banner, your visitors’ choices and your proofs of consent keep working
  • What waits for a key: most settings, updates and support

How the trial works, in detail

Get your trial key

Your e-mail and your site. Your key arrives as soon as you confirm your e-mail.

One trial per domain. Local and staging sites never use up your key.

We keep your e-mail address to send your key and help you with it, as explained in our privacy policy. No newsletter, nothing else.