RE: [flexcoders] Flex RemoteObject and Browser cookies
The Player uses the browser's HTTP stack, so outbound remoting requests will automatically carry any cookies that were previously set by the target domain (mod constraints like cookie paths, etc. that may limit the scope of the cookie). Double check that the cookies you're wanting to see actually apply to the domain/path/etc. that the remoting request is sent to. Seth From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Vijay Ganesan Sent: Friday, August 29, 2008 1:05 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Flex RemoteObject and Browser cookies I have Flex-based Flash content running within a DHTML page. The swf contained in the page makes RemoteObject (mx.rpc.remoting.mxml.RemoteObject) calls to the backend servlet. In these calls, I need to be able to send the Browser cookies set by the containing DHTML app. Currently the only cookie that seems to come through is the JSESSION cookie. I realize I can read the Browser cookies using ExternalInterface to invoke JavaScript, but once the cookies are read, how does one pass these cookies along when making a RemoteObject call in my Flex code? Thanks Vijay
RE: [flexcoders] Flex RemoteObject and Browser cookies
If you are using HTTP-based channels, all of the cookies set by the server should be returned to the client via the RemoteObject calls. Since you are seeing the jsessionid, it sounds like you are using HTTP based channels. If all cookies are not making it to the server, it may be because you are using two different cookie domains in your application. As part of the set-cookie header, you can specify additional information which broadens or narrows the scope of the cookie's setting. If you can sniff out the headers for the set-cookie operation using an HTTP traffic sniffer or logging on the server, you might see a difference in how these cookies are being set or in how the URLs are formatted going to the server. Any difference in the server-name or port specification can alter the cookie domain/handling - i.e. even http://foo.com and http://foo.com:80 may be treated as different cookie domains. Definitely watch out for localhost versus myserver.com as that is a common way to switch cookie domains too. Jeff From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Vijay Ganesan Sent: Friday, August 29, 2008 1:05 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Flex RemoteObject and Browser cookies I have Flex-based Flash content running within a DHTML page. The swf contained in the page makes RemoteObject (mx.rpc.remoting.mxml.RemoteObject) calls to the backend servlet. In these calls, I need to be able to send the Browser cookies set by the containing DHTML app. Currently the only cookie that seems to come through is the JSESSION cookie. I realize I can read the Browser cookies using ExternalInterface to invoke JavaScript, but once the cookies are read, how does one pass these cookies along when making a RemoteObject call in my Flex code? Thanks Vijay inline: image001.jpginline: image002.jpg
Re: [flexcoders] Flex RemoteObject and Browser cookies
Hey Vijay, I've done something very similar with mx:Webservice. I learned that if a swf is embedded from the same domain that it is trying to contact, the cookies are passed along. For Example: I have a swf embedded from embed.abc.com I have a cookie set on domain .abc.com I make a webservice request to ws.abc.com, the cookie set on .abc.com is passed along automatically. Hope this helps. Nate On Fri, Aug 29, 2008 at 1:05 PM, Vijay Ganesan [EMAIL PROTECTED]wrote: I have Flex-based Flash content running within a DHTML page. The swf contained in the page makes RemoteObject (mx.rpc.remoting.mxml.RemoteObject) calls to the backend servlet. In these calls, I need to be able to send the Browser cookies set by the containing DHTML app. Currently the only cookie that seems to come through is the JSESSION cookie. I realize I can read the Browser cookies using ExternalInterface to invoke JavaScript, but once the cookies are read, how does one pass these cookies along when making a RemoteObject call in my Flex code? Thanks Vijay