On Dec. 22 last year, I discovered I’d left my bag — complete with my iPad, a month-old MacBook Air laptop and all my sensitive data — in a café. A telephone call confirmed that it had been taken. To make matters worse, I’d left a text file containing my log-in details for more than 100 websites — including those for my online bank — open on my laptop.

The loss of mobile devices can happen to anyone, but none of us thinks that we will be the unlucky victim. As someone who has edited multiple computer security magazines, I thought this couldn’t possibly happen to me. But it did.

Now, I am determined to prevent this happening to you. So, what should I have done to secure the data on my devices? Or, at least, done to mitigate the risk after leaving them behind? And what should you do?

First of all, if I’d had the wherewithal to change a simple security setting on my computer, it would have made my machine far harder for any opportunist thief to steal data from. Setting the system to prompt for a password when it recovers from “sleep” or “screen saver” mode makes it harder for an unauthorized person to access your PC. However, make sure the password is a random string of characters and numbers, or at least a long passphrase, rather than your spouse’s middle name or something equally obvious and guessable.

Second, encrypting the hard drive makes it difficult for any thief to try to analyze the drive using a forensics tool. The Mac has a hard-drive encryption system called FileVault, which can encrypt data automatically. For the PC, Vista and Windows 7 have BitLocker for the same purpose. However, you have to enable these systems manually.

One strong recommendation is the use of computer tracking software. For iPhones and iPads, Apple’s Mobile Me service includes an option called Find My iPhone. This feature uses geolocation to pinpoint the whereabouts of your lost device when it connects to the Internet. This application can also be programmed to display a message on the device to its current holder, which could include your telephone number. And you can set a passcode for the device remotely, so that it can’t be accessed, and in the event that the finder doesn’t return it and can’t be located, you can remotely wipe all of your data from the unit by issuing an online command.

On the Mac and PC, you need third-party software for this purpose. PreyProject (http://preyproject.com/) is a free, open-source system that installs a low-profile software application that runs in the background on your computer. When the machine connects to the Internet, it checks the PreyProject server to see if the device has been reported as lost or stolen. If so, it begins broadcasting data to the server about its location. It can also take pictures of the thief with the device’s webcam, and can send images of the desktop. (Perhaps the thief will be logged in to his or her Facebook account, which would provide some clue of identity/location.)

The advantage of the PreyProject software is that it works for Mac, Windows, Linux and Android devices, so it will be suitable for your Android mobile phone as well as your laptop.

Another product, Lo-Jack (www.absolute.com/en/lojackforlaptops/), includes a service element. Absolute Software, which sells the product, will work with police to help with the recovery of your laptop. Users must pay for this software, however.

Finally, always use a password manager to store your sensitive passwords. Rather than having the browser store your credentials, use a third-party system such as Lastpass (https://lastpass.com/), which encrypts your passwords. It will store an encrypted copy of your password file both locally on your laptop and on an Internet-based server. The file can be accessed only by using a password string that you keep secret.

Ironically, I was preparing my passwords for importing into Lastpass on that fateful day. The computer was stolen before I had completed the process. IE