jeffbrand.net

tagline in progress

Using Session Cookies with SWFUpload, Despite the Bug in Adobe’s Flash Plugin

While adding SWFUpload to a current project, I ran into a fairly well-known Flash bug. In this case, it prevented the logged-in user from re-establishing their session values.

Depending on your situation, the solution is simple enough: pass along the Session ID during the file upload, re-establish the session manually before trying to process any data that may be located in the Session. The code suggested in the forum looks something like this:

if (isset($_POST["PHPSESSID"])) {
    session_id($_POST["PHPSESSID"]);
}
session_start();

In SWFUpload, all you need is to add a post parameter.

In my case, the Session was already started and changing the session ID did nothing. The trick is to use session_write_close() to end the existing session, set the new ID, and start it again. My code looks like this:

if (isset($_POST["PHPSESSID"])) {
    session_write_close();             // End the previously-started session
    session_id($_POST["PHPSESSID"]);   // Set the new session ID
    session_start();                   // Start it
}

Of course, the best solution would be for Adobe to fix the problem, but hopefully this explanation will help others until then.


Initial Thoughts: Buffalo Technology WHR-HP-G300N Router

I recently purchased a brand new high-power router from Buffalo Technology, model WHR-HP-G300N. This router in particular advertises the use of DD-WRT firmware for configuration and customization. Since I prefer to use DD-WRT whenever possible, Buffalo’s adoption of it is a huge bonus.

After setting it up I did the usual connectivity tests and found extremely low connection speeds and lots of dropped packets. A speed test rapidly dropped to under 1Mbit/sec. It seems I’m not alone. Just to make sure, I took removed the router from the network and received speeds between 20-25Mbit/sec with the ISP’s speedtest utility. All indications strongly point to the router.

While there are more people with questions than answers, I’ve seen a few possible suggestions that bear exploration:

  • Change the router mode switch from “Auto” to “on”
  • Call tech support
  • Upgrade the firmware

I’ve long been a fan of Buffalo’s products. I’ve purchased a number of their 802.11G devices and watched as their LinkStation NAS spawned the Kurobox project – a manufacturer-sanctioned customization of their Linux-based firmware. I hope that the resolution to my current problem is straightforward and that I can continue to stand by their products.

Update: 12/2/2010

The problems went away on their own. Just to be sure, I left the Router mode switch in the On position.


Moped Rebuild: Let’s begin

The Plan

After working on a Honda Express II last summer, I decided that it was time to purchase a real ride. The idea was to find  a working scooter in good, ride-able condition. I wanted to be able to fill it with gas, put in the key, and ride around town. No hassles, just 2-wheeled freedom.

OK, 1.. 2.. 3.. rebuild!

Instead, I found the cheapest, most run-down moped I have ever seen and bought it.

The Project

When I first saw the photo on craigslist, I didn’t know what I was looking at. I just knew it was old and it was $50. The NEW plan was to see how much it would cost to rebuild properly, or just part it out and make back the money spent.

It turns out that I had purchased a 1964 Honda C102, commonly known as a Honda Super Cub. The prospect of restoring an early Honda moped was quite interesting. It had a lot of specs that I was looking for in my original purchase: 2 seater, 4-stroke engine, and it doesn’t look like as much of a toy (compared to the Honda Express II at least.)

Given the condition and age of the bike at the time of purchase, nothing less than a complete rebuild is required. Unlike my hasty repairs on my last moped, I really feel a moped of this age and significance needs a lot of attention to be a safe, fun, and attractive when it’s done. At the same time, I have a new opportunity to learn about the mechanics of it.

So, the list of tasks:

  • Complete the engine – it’s missing the cylinder, head, piston, and valves
  • Tear the bike down completely
  • Rebuild the engine, transmission, clutch, and starter
  • The usual rebuild maintenance: clean the carburetor, replace gaskets, air filter, decarbonize muffler, check contact points
  • Rebuild the suspension, steering  bearings
  • Clean the wheels, replace the breaks if necessary
  • Review the electrical system
  • Repaint the frame!
  • Put it back together
  • Ride!!

The project began April 1st, when the bike was delivered.. Let’s see how long until I get it on the road.

How hard can it be?!


Firefox 3.5 has arrived

Mozilla Firefox 3.5 has been released. They claim improved JavaScript performance and an overall faster browsing experience. I really hope that’s the case.

My main development station is a Thinkpad T30. Not the fastest machine around, but rock solid IBM design. It’s starting to show its age, especially on JS heavy sites, so any software-based optimizations to web browsing are very helpful.

As I write this, I have to say that I think that the WordPress interface is a bit snappier. Twitter, also, doesn’t lag behind as I type in a new message.

I am also very excited about the <video> tag, even if I won’t be able to use it fully until Internet Explorer finally implements it.. in 2012?


Dreamhost API Contest

Web hosting company Dreamhost has recently began to release an API for their users to develop their own special utilities. To help promote the creation of new applications, they are sponsoring a contest with $12,000 in prizes!

I’m having a hard time thinking of useful tools that do anything more than relocate their existing control panel’s operations. The API is still in early stages and doesn’t really have too many operations available. However, I’d sure appreciate any suggestions!