How to Make the WordPress Login Cookie Last Longer Than Two Weeks

One thing I loathe about WordPress 2.5 is login cookies only last two weeks. So every two weeks I get prompted to login again. It is extremely disruptive to have to log in again, when just a few hours earlier I was logged in. The cookie logic should be tweaked that if you haven’t logged in over the past two weeks, then (maybe) the cookie should expire. but if I was allowed to work on the blog yesterday, why should I need to log in again today. The two week window should not be based on when I first logged in, but on when I last did administrative functions while logged in.

There aren’t any plugin hooks to the cookie setting functions of WordPress 2.5. But you can edit line number 547 of pluggable.php (which is under wp-includes of your WordPress installation) to lengthen the amount of time a cookie is stored for. Simply change the number at the end of the line
$expiration = $expire = time() + 1209600;
to ever how many seconds you want the cookie to be good for.

Two Weeks: 1209600
One Month (30 days): 2592000
One Year (365 days): 31536000
Ten Years (3650 days): 315360000

Once you’ve made that change, log out (in the top right of the administrative area) and then log in again to create the new cookie with the longer login time. Or simply wait two weeks for your cookie to expire, and then the next time you login, you’ll be all set.

Yes, I can see how this might be a security issue, since an attacker may stay logged in for a long time, and get past any system upgrades. (A system upgrade though should wipe any stored logins. Which doesn’t appear to be possible currently, since the cookie doesn’t store which version of WordPress the cookie is good for.) Or if your machine is compromised, your blog can be compromised. But generally, if that happens, you’re screwed anyways. So in this instance, ease of use is trumping security for me.

If you're new here, you may want to subscribe to my RSS feed. This allows you to read my newer articles without having to visit the site again. Thanks for visiting! Mike

Posted under Plugins, WordPress

This post was written by Michael Clark on June 30, 2008

Akismet 40,000th Spam Comment

On May 1st, I zapped my 30,000th comment spam. Yesterday was the 40,000th. Here’s a chart of the count, recorded daily.

And here’s the daily rate, with a peak since May 8th (the end of the last storm) at 160 on June 6th, and a low of one on May 19th.

Posted under Spam

This post was written by Michael Clark on June 27, 2008

HELO {bot_hostname}

This morning I received a string of bot spam attempts from some idiot spammer using the following as his HELO command (yes, including the braces):

HELO {bot_hostname}

Luckily Postfix rejected the conversation immediately.

Posted under Spam

This post was written by Michael Clark on June 26, 2008

Showing the Post’s Time on the WordPress Edit Posts Page

I prefer having the time listed on the “edit posts” page under the WordPress admin area, instead of just the date of the post. Usually the URL you see this is something like (WP-base)/wp-admin/edit.php. I don’t see a hook to manage this format, so I couldn’t write a plugin. (If there is a hook, please let me know what it is!)

To edit the date and time that are displayed, simply edit line #74 in wp-admin/edit-post-rows.php (line 74 in WordPress 2.51, the line number may be different in other versions of WordPress). Change the portion that says “Y/m/d” to “Y/m/d H:i” and you’ll then see the time listed on the edit.php page. You can use any of the date/time formats defined by php.

Posted under WordPress

This post was written by Michael Clark on June 5, 2008

Verizon Updating Their TOS Again

I just received an email letting me know that Verizon is again changing their terms of service. It’s interesting that the first item listed below means they are changing their privacy policy and are going to share your account and identifying info if they even think you’re doing Bad Stuff. I wonder what was wrong with simply waiting for a legal order of some sort?

Also, i wonder if item #4 below means they could block bit torrent traffic?

And if you do go to the URL they provide for seeing more information (www2.verizon.net/policies) you have to give your area code and exchange to see the info. Hmmm, trying to keep researchers and other interested people out perhaps? Is anyone interested in a research project to see how the policies are different in different areas?

Effective June 9, 2008 - Important Information Regarding Changes to Your Verizon Online Terms Of Service

The following is an outline of important changes to the Verizon Online Terms of Service which are effective as of June 9, 2008. We have described these changes in general terms below and recommend that you review the complete Terms of Service to determine how these changes, and other routine changes being made simultaneously, apply to you or your use of the Service. The Terms of Service can be accessed by clicking on the “Policies and Terms of Service” link (www2.verizon.net/policies) at the bottom of any page of our Website. The Terms of Service, as revised, will govern your rights and obligations, and ours, with respect to your use of the Services we offer. As set forth in Paragraph 3 of the Terms of Service, your continued use of the Service after the effective date of these changes will constitute your agreement to the changes.

1. Reporting of Actual or Potential Violations of Child Pornography Laws. We have added language to our Acceptable Use Policy (AUP) making clear that the Service cannot be used in any fashion for the transmission or dissemination of images containing child pornography. In addition, in Section 5, Privacy Policy; Legal Compliance, we have added language making clear that (a) we are required by law to report any facts or circumstances reported to us or which we discover from which it appears there may be a violation of the child pornography laws; and (b) that we reserve the right to report any such information, including the identity of users, account information, images and other facts to law enforcement personnel.

2. Billing Start Date for Additional Services. In Section 8.1, Prices and Fees; Billing, we have added language stating that, unless otherwise noted at the time of purchase, billing for the Additional Services set forth on Exhibit B will begin either on your Service Ready Date if you are also ordering new Broadband Service or upon submission of your order if you are ordering only an Additional Service.

3. Refundable Deposits. We have added a new Section 8.8, Refundable Deposits, which permits us, in certain instances, to require a refundable deposit either prior or subsequent to activation of Service.

4. Modifications to AUP. We have added language to our AUP making clear (a) that we may monitor our subscribers‚ compliance with our Terms of Service and AUP; and (b) that we have the right, but not the obligation, to pre-screen, refuse, move or remove any content available on the Service including, but not limited to, content that violates the law, our Terms of Service or our AUP.

5. Verizon Premium Technical Support (PTS). We have added a new Section 6 to Exhibit B, Additional Terms, which sets forth the terms and conditions governing our provision, and your use, of the PTS service.

Please take time to review the complete Verizon Online Terms of Service. Thank you for being a Verizon Online customer.

Posted under Technology

This post was written by Michael Clark on June 3, 2008

eHealthInsurance.com Spam

Be careful if using eHealthInsurance.com. They do not honor unsubscribe requests from their mailings. I’d suggest using a unique email address so you can disable it after you’ve used their services. I’ve emailed their privacy office asking about this. If a week goes by, I’ll escalate to TRUSTe.

I originally signed up with them on October 9th, 2007, unsubscribed on March 24, 2008 (after they emailed me five months after my last contact with them), and then again today (June 2, 2008) two months after opting out.

Posted under Spam

This post was written by Michael Clark on June 2, 2008