[ 
https://issues.apache.org/jira/browse/RIPPLE-29?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13686112#comment-13686112
 ] 

Brent Lintner commented on RIPPLE-29:
-------------------------------------

Hey Chris,

I apologize for the delayed reply. :-)

I've had some experience trying to get Cookies to work in Ripple (when working 
on the 'emulate' command and XHR proxy), but I have yet to (take the time to) 
test and figure it out entirely- I think I've run into the similar issues you 
have.

I'm unfamiliar with /etc/hosts and cookies (don't use them much or at all).. 
could you elaborate more? (sorry).

Regardless of that, for what it is worth.. I did find you could set and forward 
Cookies on localhost when using 'ripple emulate --remote http://localhost:XXXX' 
where XXXX is a local port that original app is running on (the browser seemed 
to forward a Cookie header then). I'm not sure whether that is a feature or a 
bug, to be honest, but it seemed to work.

If you meant setting Cookies via XMLHttpRequest, Unless it works when doing 
what I mentioned above, I don't believe that is possible. Although, off the top 
of my head, one solution could be to turn off the XHR proxy entirely (via the 
settings panel) and add support for Cross Origin Resource Sharing (CORS) to 
your locally hosted application (even just for dev), and make calls directly to 
it.

Sorry to not be as much of a help. I have a bunch of things I want to get done 
on this project, but if I get a chance to really dig into things, I'll be sure 
to post (and fix things if it is the case). :-)

PS: I doubt it, but it could also be that the code is missing something to 
handle that. FYI:

    
https://github.com/apache/incubator-ripple/blob/master/lib/server/emulate/hosted.js#L35-L108
    
https://github.com/apache/incubator-ripple/blob/master/lib/server/proxy.js#L55-L115
                
> Cookies for localhost ?
> -----------------------
>
>                 Key: RIPPLE-29
>                 URL: https://issues.apache.org/jira/browse/RIPPLE-29
>             Project: Apache Ripple
>          Issue Type: Question
>         Environment: Lamp, Virtualbox, Ripple, Cordova
>            Reporter: Chris Schaub
>
> I can't *seem* to get Ripple to accept cookies. Is there any way to get 
> Ripple to accept cookies when the hostname is in the /etc/hosts file? I'm 
> doing dev locally, and I can't get it to happen. I've tried every combination 
> I can think of, no dice. I know it won't work with localhost due to browser 
> restrictions.
> My virtual box is running a php application that is passing json data back 
> and forth. I can see the login happen on the php side and the session cookie 
> get started. But it never makes it back to the OSX side running Ripple. I'm 
> assuming I'm in some sort of CSRF hell. I've tried setting domains, nothing. 
> Does Ripple support setting cookies when emulating?
> Thanks for any pointers or help.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to