How can i turn off cookie prompts and disallow cookies in the Lynx browser?
Here is my .lynxrc:
ACCEPT_ALL_COOKIES:FALSE
SET_COOKIES:FALSE
Thanks
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityThat's the wrong syntax for .lynxrc
(it's correct for lynx.cfg
—the two files use different format).
The documentation for the features in lynx.cfg
is extracted from its comments into the website:
ACCEPT_ALL_COOKIES
(website):
ACCEPT_ALL_COOKIES
– Cookies
Description
If ACCEPT_ALL_COOKIES
is set TRUE, Lynx will accept cookies from all domains with no user interaction. This is equivalent to automatically replying to all cookie 'Allow?' prompts with "A"lways. Note that it does not preempt validity checking, which has to be controlled separately (see below). The default is defined in userdefs.h and can be overridden here, or in the .lynxrc file via an o(ptions) screen setting. It may also be toggled via the -accept_all_cookies command line switch.
Default value
ACCEPT_ALL_COOKIES:FALSE
versus lynx.cfg
.h2 ACCEPT_ALL_COOKIES
# If ACCEPT_ALL_COOKIES is set TRUE, Lynx will accept cookies from all
# domains with no user interaction. This is equivalent to automatically
# replying to all cookie 'Allow?' prompts with 'A'lways. Note that it
# does not preempt validity checking, which has to be controlled separately
# (see below).
# The default is defined in userdefs.h and can be overridden here, or
# in the .lynxrc file via an o(ptions) screen setting. It may also be
# toggled via the -accept_all_cookies command line switch.
#
#ACCEPT_ALL_COOKIES:FALSE
Because .lynxrc
is written by the program, there is no need to manually edit it. Initially (through the 1990s) Lynx settings were either in lynx.cfg
or .lynxrc
, with no overlap. That was intentional, since Lynx was often used in a kiosk configuration where the user was prevented from changing settings that were intended to be the same for all users. Later, other developers added features that they intended to be in both the system- and user-configurable files. Still later (in 2001), the ENABLE_LYNXRC
feature was introduced to allow users to save any setting. However, the cookie configuration dates from that interim period, as you can see by the customized comment in the .lynxrc
file which Lynx would save from the Options menu:
# accept_all_cookies allows the user to tell Lynx to automatically
# accept all cookies if desired. The default is "FALSE" which will
# prompt for each cookie. Set accept_all_cookies to "TRUE" to accept
# all cookies.
accept_all_cookies=off
ACCEPT_ALL_COOKIES
comes from, and in quoting it, the reader might notice the mention of the options-menu. Following the bullets, I pointed out how .lynxrc
differs from lynx.cfg
(there's more than two points in the answer).
Jul 26, 2020 at 13:30
SET_COOKIES:FALSE does the trick on Lynx Version 2.9.0dev.5 (27 Feb 2020).
If you wish to use your own lynx.cfg, and you are on bash, you need to update .profile and add the following line. You can also execute it directly on the command prompt.
LYNX_CFG=~/lynx.cfg; export LYNX_CFG
Then ~/lynx.cfg, will look like
#includes the default lynx config (Debian distro)
INCLUDE:/etc/lynx/lynx.cfg
SET_COOKIES:FALSE
It looks likes lynx's documentation is completely outdated.
~/.lynxrc
must contain:
accept_all_cookies=off
Here's how I've found it out. Please delete ~/.lynxrc
, run lynx, press O, and then configure it (don't forget to mark the checkbox: Save options to disk).
The utility and its documentation are completely messed up: I've read the sources and accept_all_cookies
only accepts TRUE
and FALSE
both of which are not what the OP is looking for.
There's also the cookie_reject_domains
option but it doesn't accept wildcards:
# Note that in order to match cookies, domains have to be spelled out exactly
# in the form in which they would appear on the Cookie Jar page (case is
# insignificant). They are not wildcards. Domains that apply to more than
# one host have a leading '.', but have to match *the cookie's* domain
# exactly.
In short, you may want to fix the utility and send them a patch.
lynx2.8.9rel.1.tar.bz2
. There's no way to make it not accept cookies for all sites without a prompt.
Jul 28, 2020 at 6:16