I am not sure GMail allows this, but you can try to save the cookies. It's likely GMail sets cookie on login, and after redirect it can't find them.
Besides that, if you are just trying to get to your email, you can enable POP or IMAP in GMail and use the corresponding PHP functions for it.
pritaeas
Posting Prodigy
9,533 posts since Jul 2006
Reputation Points: 1,194
Solved Threads: 1,494
Skill Endorsements: 98