[Flashcoders] Set HTTP cookies with navigateToURL()
Hello, I have a small multiplayer Flash game in which you can display a player profile by clicking at his or her avatar: const PROFILE_URL:String = 'http://myserver/user.php?id='; try { navigateToURL(new URLRequest(PROFILE_URL+id), '_blank'); } catch(e:Error) { } This works well, but now I'd like to extend the user.php, so that players can add comments about each other. For authorization I'd like to use HTTP cookies, passed from the game.swf to the user.php. (I don't want use GET or POST here, because GET will have the auth. variables in the URL and players might occasionaly send that URL around or post it in my forum. And POST will ask to re-post the request when you reload). My problem is, that I can't find the way to set HTTP cookies through the navigateToURL() method. Please advise me Regards Alex ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Set HTTP cookies with navigateToURL()
Alexander Farber skriver: My problem is, that I can't find the way to set HTTP cookies through the navigateToURL() method. Please advise me Normally it would be the same as any other http header, it's part of the URLRequest class. However, the cookie related headers are on the blacklist. Adobe very specifically says that you may not set it. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Set HTTP cookies with navigateToURL()
If you have access to Javascript, you can set the cookies like this. ExternalInterface.call(function() { document.cookie = 'foo=bar; expires=Mon, 15 Nov 2010 23:59:59 UTC; path=/'; }()); navigateToURL(new URLRequest(somepage.php)); Then in somepage, your data will be available in $_COOKIE; Cheers Juan Pablo Califano 2010/11/13 Alexander Farber alexander.far...@gmail.com Hello, I have a small multiplayer Flash game in which you can display a player profile by clicking at his or her avatar: const PROFILE_URL:String = 'http://myserver/user.php?id='; try { navigateToURL(new URLRequest(PROFILE_URL+id), '_blank'); } catch(e:Error) { } This works well, but now I'd like to extend the user.php, so that players can add comments about each other. For authorization I'd like to use HTTP cookies, passed from the game.swf to the user.php. (I don't want use GET or POST here, because GET will have the auth. variables in the URL and players might occasionaly send that URL around or post it in my forum. And POST will ask to re-post the request when you reload). My problem is, that I can't find the way to set HTTP cookies through the navigateToURL() method. Please advise me Regards Alex ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders