"Enable Cookies to toggle full article text"



  • Instead of the usual link to enable full articles, I get this "Enable Cookies to toggle full article text" since like today. But the funny thing is, I did enable cookies. So, uhm, I guess I found a bug!

    Using Opera 9.24 on XP. Didn't know where else to post this.



  • Seems to work fine for me using Opera 9.24 on Ubuntu Linux.



  • @Daniel15 said:

    Seems to work fine for me using Opera 9.24 on Ubuntu Linux.



    +1

    Also, the real WTF is that TDWTF has such a large Opera userbase.



  • I saw that once..but I refreshed and it went away. The text is displayed using Javascript...

     <script type="text/javascript">
      if (document.cookie)
      {
          var tDisplay = 'Display';
          var tSummary = 'Summary';
          var tFullArticle = 'Full Articles';
          document.write(tDisplayj + ': ');
          if (false)
          {
              document.write('<b>' + tFullArticle + '</b> | <a href="JavaScript:setDisp(false)">' + tSummary + '</a>');
          }
          else
          {
              document.write('<a href="JavaScript:setDisp(true)">' + tFullArticle + '</a> | <b>' + tSummary + '</b>');
          }
      }
      else
      {
          document.write("Tip: Enable Cookies to toggle full article text");
      }
     </script>
     <noscript>
         Tip: Enable JavaScript &amp; Cookies to toggle full article text
     </noscript>

    Any ideas? I'm guessing that "document.cookie" is empty. Maybe I should set a cookie server side so this doesn't happen?



  • The document.cookie variable is essentially a string value. If the user has no cookies for the site in question, the value is an empty string. This, of course, evaluates to false as far as Javascript is concerned, and the warning message is shown. So if you clear your site cookies and load the main page, you get that message. At the next page load, it seems to be gone, since there are now some cookies that have been created, and the "if (document.cookie)" evaluates to true (tested this in IE and FF).

    My guess is that the site's cookies (or at least the ones that would be set from viewing the front page) are being set after the page has loaded, via Javascript. The other problem is that your script is essentially testing the value of the HPDISPALL cookie without initializing it to a default value if it doesn't exist yet.

    Also, I'm hoping that "if (false)" bit is being generated server-side. 😉

    This page suggests you should use the navigator.cookieEnabled property to determine if cookies are enabled (though I'm not sure how standards-compliant that approach is). You could always try doing something on body.onload that tries to set and read back a cookie, then sets a global variable indicating whether cookies are enabled.



  • Make sure you haven't set site prefs to disallow it by mistake. I believe that can happen simply by disabling cookies globally, then going into "site preferences" and clicking ok (this will set it to whatever is the global at the moment). Even if you later enable cookies, site prefs will override it. (There really should be a "no preference" / "use global" option in there.)

    Note: I use an older version though, so the above might not be true for you.



  • The same thing happens to me every time I clear my cookies (in FF 3.0). A single reload of the front page always fixes it, so IMHO this bug is nothing to worry about.

     



  • @Rotary Jihad said:

    @Daniel15 said:

    Seems to work fine for me using Opera 9.24 on Ubuntu Linux.



    +1

    Also, the real WTF is that TDWTF has such a large Opera userbase.

     

    Opera is the best browser on my laptop.



  • @Mal1024 said:

    Opera is the best browser on my laptop.

    Fixed that for you.



  • @why? said:

    @Mal1024 said:
    Opera is the best browser on my laptop.

    Fixed that for you.

    BROWSER WAR

    Full page zoom too often fucks the page, and I dislike the wand, and several of its interaction details.

    But it's not all bad. It has the best damn javascript error trapper ever ever. It's pretty and smooth and quick.

    It's just that moving to it from FFX would be a lateral move.



  • @dhromed said:

    @why? said:

    @Mal1024 said:
    Opera is the best browser on my laptop.

    Fixed that for you.

    BROWSER WAR

    Full page zoom too often fucks the page, and I dislike the wand, and several of its interaction details.

    But it's not all bad. It has the best damn javascript error trapper ever ever. It's pretty and smooth and quick.

    It's just that moving to it from FFX would be a lateral move.

    How does one get the want to actually put the username/password it saved back into a form?



  • Happy 0x800, dhromed!

    And related to Opera, since I set the cookie security settings to "anal", I get a big fat warning whenever I look at the front page ("The site tried to use a cookie for exploitative purposes", or something like that). About time to do a search-and-replace for "worsethanfailure", I think.



  • @Lingerance said:

    @dhromed said:

    @why? said:

    @Mal1024 said:
    Opera is the best browser on my laptop.

    Fixed that for you.

    BROWSER WAR

    Full page zoom too often fucks the page, and I dislike the wand, and several of its interaction details.

    But it's not all bad. It has the best damn javascript error trapper ever ever. It's pretty and smooth and quick.

    It's just that moving to it from FFX would be a lateral move.

    How does one get the want to actually put the username/password it saved back into a form?

    Ctrl+Enter in the username or password field, I think.

    Can't remember exactly, I don't use it that often.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.