How can i turn off cookie prompts and disallow cookies in the Lynx browser?
Here is my .lynxrc:
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 community
That'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 – Cookies
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.
.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
.lynxrc is written by the program, there is no need to manually edit it. Initially (through the 1990s) Lynx settings were either in
.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
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:
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
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.