Hybrid View

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    6
    Vote Rating
    0
    adi.shoukat is on a distinguished road

      0  

    Default Unanswered: Sencha Touch 2 Session problem

    Unanswered: Sencha Touch 2 Session problem


    I am calling the APIs of my web-service to run the Sencha touch application.
    When I hit the login API directly from browser, it sets the SESSION variable that I can access later.


    But when I call the same API diagrammatically from my Sencha Touch Application it logs me in successfully but it doesn't set the SESSION variables. i.e. I cannot access the session variables in further APIs.


    I am not sure if the problem is on Client side or on Server side. Any thoughts?

    (Using Coldfusion as server side language)

  2. #2
    Sencha User
    Join Date
    Oct 2012
    Posts
    6
    Vote Rating
    0
    adi.shoukat is on a distinguished road

      0  

    Default


    Fixed !!
    In response of Login API I also returned #SESSION.CFID# and #SESSION.CFTOKEN#

    Now with every API I am sending these variable: ?CFID=123&CFTOKEN=334455
    And finally the Coldfusion can recognize my session

  3. #3
    Sencha User
    Join Date
    Jan 2013
    Posts
    3
    Vote Rating
    1
    anantasaurabh is on a distinguished road

      0  

    Default


    This information might be useful to others.
    when making an ajax request to cross domain session state is not maintained.
    you need something like this.

    Code:
    Ext.Ajax.request({             url: 'http://myurl/log_user_in.json',             params: { username: user, password: pass, app_id: id },             withCredentials: true,             useDefaultXhrHeader: false,             method: "POST" })
    more info here
    http://stackoverflow.com/questions/1...g-ajax-request

Thread Participants: 1

Tags for this Thread