The Highs and Lows of Web Development

Sometime website development can be very frustrating, and as a freelance web developer with few people to turn to when I come across a problem I really get to experience the highs and lows.

Just the other day whilst working on a fairly complex project that I have on at the moment I came across a bug in my coding. The application I’m developing requires members to register and be logged in before they can access the data. This was all working well, the sign up process worked perfectly and the restrictions were in place, but then we noticed that when members tried to go to the 2nd page of a series of results they were logged out of the system and couldn’t access them. If they then logged in again they were free to go wherever they wished within the site as they should be.

It took me over four hours to track down the bug. I rewrote loads of things, checked that the sessions and cookies were getting written properly, tested, re-tested and tested again but all with no joy until I noticed a missing hyphen in a URL. All of that trouble due to a single missing hyphen, just a pesky little – !!!

For those in the know, what was happening was that my scripts were writing sessions and cookies associated with a domain with a hyphen, but the script that generated the links to the various pages were getting the base URL from a database. When entering the URL into the database I had omitted the hyphen.

Now, normally this would have been easy to diagnose as the incorrect URL would have thrown up a ‘domain not found’ or ‘page not found’ error. However, in this case, my client had also registered the hyphen-less domain name and had it pointing to the same server. This meant that the page was being found on the other domain but the user was logged out as the session / cookies had been written for the domain with the hyphen.

I have to admit though it was quite satisfying when I did eventually find the error, fixed it, tested it and all was working! I guess without little problems such as these there wouldn’t be any satisfaction to be gained from such activities.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Avatar forComment Author

Alan Cole

Alan is a Freelance Website Designer, Sports & Exercise Science Lab Technician and full time Dad & husband with far too many hobbies: Triathlete, Swimming, Cycling, Running, MTBing, Surfing, Windsurfing, SUPing, Gardening, Photography.... The list goes on.