简体   繁体   中英

Sending cookie from Rails API to Ionic build, Ionic doesn't receive the cookie

I am sending a cookie back from a Rails API to an Ionic cell phone app, which for testing purposes I am first running in the browser.

Here is the Rails code in question.

cookies[:cookie_test] = { value: 'cookie received', expires: 1.year.from_now, domain: :all }

I am using Chrome dev tools to see what cookies are stored, and I can't find the cookie I'm trying to set.

Is there a configuration flag I'm missing?

I don't think you are supposed to use cookies when building mobile applications, you should do it through Authorization headers, I explain this further on:

http://apionrails.icalialabs.com/book/chapter_five#cha-chapter_five

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM