As for spoofing the IP address... another rambling "think out loud"...
Using curl, we make a single request to the server and retrieve the HTTP response. I think this is just a single string of text, so we save this to a file to be used later.
I haven't used curl enough to know this yet, so I don't know if it is possible, maybe you can use perl to do it...
If you can work at the TCP/IP level, we may be able to spoof it...
As far as i'm aware this is how I think connections are set up:
Computer A sends out a packet to computer B :
"This is computer A, are you computer B?"
Computer B replies...
"Yes this is B, are you computer A?"
computer A confirms...
"Yes computer B, this is A"
Maybe this can be spoofed.
If we know the clients IP address, we can contact the server using this.
Obviously, the server's replies are going to go to the client, and not us.
Having not instantiates the connection, the client ignores the server's replies.
However, the server is awaiting confirmation from the client.
What i'm thinking is, if we send the connection request packet to the server, and then send the confirmation packet a few hundred milliseconds later, again pretending to be the client, the server should be happy with that and the connection would be approved.
Now we can send the header with curl, again with our spoofed IP, referer etc.
Obviously the HTTP response is going to go back to the client, but thats OK - because we already have a response from the server saved on our own webserver.
Just like in my post above this one, we use the cookie information in this response to stuff the client. There will be certain bits which need to be altered before stuffing - expiry time / date etc, but we could use the time/date on our own sever to set these fields.
Thats the end of my little ramble, and it contains alot of speculation.
Again, i'm not too knowledgable in this area so, I may just be talking aload of crap.