Learn something new every day

July 25th, 2007 § 2 comments

Until today, I did not realize that any HTTP requests made by a Flash movie (including LoadVars.load(), MovieClip.loadMovie(), Sound.loadSound(), etc) includes cookies — the cookies that would normally be sent by the browser anyway. In retrospect, this makes sense and is perhaps even obvious: since the Flash player asks the browser to make the connection, then it really is the browser doing the requests, so why wouldn’t the browser send and receive cookies as normal? For some reason, though, it was a surprise to me.

What does this mean? It means that it’s much easier for a widget to work in conjuction with PHP sessions, for example: I had been putting the session ID in FlashVars so that the Flash movie could add the cookie manually with addRequestHeader(), but it turns out that that is unnecessary.

§ 2 Responses to Learn something new every day"

What's this?

You are currently reading Learn something new every day at bunnyhero dev.

meta