Page 1 of 1

Issue with Session/cookie

Posted: Mon May 12, 2014 7:11 am
by Sean Tout

Hello,

I have a very simple app.

  • one page prompts the user to login. upon successful login, user's info, including the session_id are returned + another page is loaded to display additional user data.

  • onload of the 2nd page, another service is invoked to pull other user related data.

  • nothing is passed in the request of the 2nd service. it relies on the session established to pull data.
    however I'm unable to pull any data from the 2nd service. it seems like the session_id is not being passed by the client!! below are few snippets:

    RESTService/Login Service Settings:

    Name: RESTService

    URL: http://www.sampleurl.com/login

    Method: POST

    Data Type: JSON

    Settings: None

    Security Context: None

    Content Type: JSON

    Use Appery.io Proxy: Channel-2392149

    RESTService/Login Service Response:

    {
    "header":{
    "status":200,
    "short_msg":"Login success",
    "long_msg":"You are now logged in as user111"
    },
    "body":{
    "user":{
    "user_id":"114",
    "nick":"user111",
    "password":"0c534ed3fff7d2bfd32ee19d84644e3f",
    "first":"first_user111",
    "last":"last_user111",
    "status":"1",
    "create_date":"2014-04-08 06:31:39",
    "update_date":null
    },
    "user_type":"R",
    "session_id":"92230poi43v1sn5oqb5tonpco0"
    }
    }

    the above works just fine. now to the service that doesn't work.

    UserCircle Service Settings:

    Name: userService

    URL: http://www.sampleurl.com/UserCircle

    Method: POST

    Data Type: JSON

    Settings: None

    Security Context: None

    Content Type: JSON

    Use Appery.io Proxy: Channel-2392149

    UserCircle Service Response:
    {
    "circles":[

    ]
    }

    the above is empty circles. even though the user does have few circles. I tested the same from POSTMAN (both REST Calls) and it works just fine. I tried multiple options:
    1- did not pass any parameters in the request of getCircle services (which is what the service expects). but no data back. I understood that the client automatically saves and sends the cookie/session back to the server! is that the case? or should I explicitly send the session_id?
    2- passed session_id as a header variable and as part of JSON request but no response.

    Any help would be much appreciated!


Issue with Session/cookie

Posted: Mon May 12, 2014 9:23 am
by Kateryna Grynko

Hi Sean,

How does your server read session id? Do you need to pass it in request?


Issue with Session/cookie

Posted: Mon May 12, 2014 2:06 pm
by Sean Tout

Hi Katya,

it does not require the session id to be passed in the request. but rather relies on the default browser behavior around cookies. it's a standard Apache Server with PHP! I do not explicitly specify any session info in the requests I make in POSTMAN!


Issue with Session/cookie

Posted: Tue May 13, 2014 4:19 am
by Yurii Orishchuk

Hi Sean.

Automatic cookies will not work when you use cross domain request.

In your case app located on appery.io domain. And your service on other domain. For security reason it could not be stored and used properly automaticaly.

So if you need this cookie you have to get this from headers from from your response and save it in LSV.

After you can use it when send request to your service.

If you will have a problem with this please provide us screen shots from "net" debuger tab where we can see all headers and request parameters.

Regards.


Issue with Session/cookie

Posted: Tue May 13, 2014 6:55 am
by Sean Tout

Hi Yurii,

Do you have an email I can the details to? I have a number of debug outputs that I'd like to share directly rather than a public forum!

Regards,

Sean.


Issue with Session/cookie

Posted: Tue May 13, 2014 7:28 am
by Maryna Brodina

Hello!

Please send details to a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a with a link to this thread.


Issue with Session/cookie

Posted: Tue May 20, 2014 6:21 pm
by Evgene Karachevtsev

Hello Seon,

We need the project on the Appery.io, not exported sources. We can't do anything with such sources, it is even out of our scope. What logs / password should we use? What should we look at? Please tell us the steps to reproduce error.


Issue with Session/cookie

Posted: Wed Jun 11, 2014 7:27 pm
by Evgene Karachevtsev

Hello Sean,

Did you get it worked?