rocknbil - 4:47 pm on May 29, 2012 (gmt 0)
Well that's not why it does that. A cookie is set in the browser and can't be read until the next page load because it's a single direction communication. You can't set it and read it at the same time.
You're probably going to need to do a location reload/redirect to the same page after setting a cookie.