Cookie-based authorization gives no cookie

Hello,

I am working on the file permissions for files uploaded by the user.
I have set the user permissions…

I have set the Login Cookie-based Authorization to set the cookie upon succesfull login:
image

However when the user logs in i see no cookie for the user:
image

What can be the issue here?
APP ID= 45D74295-8B81-D693-FF49-5EC08E970C00

Hello,

Cookies are not stored in Local Storage. You need to check in the Cookies section:
Cookie-based authorization gives no cookie - General - Backendless Support 2022-06-21 16-36-14

Mark

Hi Mark,

When i look there than i see the Cookie:

However in my other application where the file permissions do work i do see the Local Storage as below:
image

When cookie-based authorization is enabled, a cookie is set. From the screenshot, I see the cookie. Please keep in mind that the cookie will be associated with the domain that is used to make the Login API call. If you fetch files from another domain, that cookie will not apply.

Regards,
Mark

Thanks Mark,

That is my problem, i am on another domain, can i use file permissions without cookies based login?

You can use file permissions without cookies, but it gets tricky since you need to send an HTTP header with every GET request.

It would be easier to configure your app to use the same domain for all requests (API and files).

Regards,
Mark

Hello Mark,

Where can i find documentation on how to use file permissions with the HTTP header with every GET request? Or will the different domain remains a problem?

Hello,

It is documented here:
https://backendless.com/docs/rest/files_file_download.html

Regards,
Mark

Hello,

Is there anywhere in the documentation a workaround for this is outlined? I am having the same issue with a flutter app when I turn on auth permissions.

I tried a workaround with user-token, however getUserToken() returns null on and oauth2login and autoLogin so I wasn’t able to continue with this.

Is the best method a custom domain? Is there anywhere this is outlined in the docs?

Thanks,
Shane