I'm having a problem with a session ID refreshing. I have a block of code (http://pastebin.com/JZgtaDDA) that destroys a session and then starts a new one. If I call session_id() to retrieve the ID, it retrieves the previous ID instead.
session_regenerate_id();
The cookie is already received, telling the browser to use another (or none) on subsequent requests is to late for this specific request, is you want to start another one straight away.