Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8418601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:22:46+00:00 2026-06-10T02:22:46+00:00

i am building a Sencha Touch 2 Application with userspecific datasets. Architecture of the

  • 0

i am building a Sencha Touch 2 Application with userspecific datasets.

Architecture of the App:

Sencha Touch App <=====> Java Server backend with REST Services
( many AJAX requests =) )

What i actually have is:

  • Login the user with username/password

    The app gets initialized and the loginform comes into play. After submitting the form as a AJAX request, the server backend checks the userdata and calls the client callback function.

And what i want to do is:

  • The callback function should
    1. create a cookie with the sessiontoken or
    2. store the sessiontoken within the localstorage (http://docs.sencha.com/touch/2-0/#!/api/Ext.data.proxy.LocalStorage) or
    3. store the sessiontoken within js variable

Okay, shouldn’t be the problem.

But how can i achieve the following:

Most of the data is specific for one user and should be returned by the REST service if needed (by clicking on the navigation,…). How can i send the sessiontoken (see above) within every AJAX request – so the server can provide the suitable datasets (assuming the token is valid)?

Send cookies within AJAX requests

I have already read that cookies gets automaticly added to the request if the url is on the same space, right? The Java Server is on the same domain (localhost:8080) but the cookies aren’t available – instead of requests on urls like ‘app.json’. I thought that cross-domain-requests are really domain specific?

Send paramaters within AJAX requests

Because the cookies aren’t avi i thought about the possiblity of ‘manually’ adding parameters to the ajax requests. The App will contain many AJAX requests and thats why i dont want to add the token manually – i tried to override the requests function of Ext.Ajax but i failed ;-( :

(function() {
    var originalRequest = Ext.data.Connection.prototype.request;

    Ext.override(Ext.data.Connection, {
        request : function(options) {
            alert("Do sth... like add params");
            return originalRequest.apply(this, options);
        }
    });
})();

ERROR:

Uncaught Error: [ERROR][Ext.data.Connection#request] No URL specified

I also tried to add a listener

Ext.Ajax.add({
    listeners : {
        beforerequest :  function( conn, options, eOpts ){
           alert("Do sth... like add params");
        }
     }
});

ERROR:

Uncaught TypeError: Object [object Object] has no method ‘add’

Any idea about how i can add the token?

Or any better way of handling these case?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:22:47+00:00Added an answer on June 10, 2026 at 2:22 am

    Finally i successfully used:

    function addAjaxInterceptor(context)
    {
       Ext.Ajax.on('beforerequest', function(conn, options, eOptions)
       {
          // add the param to options...
       }, context);
    }
    

    Executed from the app (=> addAjaxInterceptor(this)).

    But the following solution is more suitable for my situation i think:

    Ext.Ajax._defaultHeaders = {
        // params as json
    };
    

    (Cause Ext.Ajax is a singleton object and i dont change the params for every request)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MVC Sencha Touch application I'm building and am having some issues
Iam using sencha touch for building mobile application, Ia m using card layout switch
I'm building a web service for a mobile app (Sencha Touch), and I'm hung
Hullo there, I am building a Sencha Touch iPhone app that utilises a TreeStore
I'm building a sencha (sencha touch 2) app which it gets some json data
I am building an app with Sencha Touch 2. I want to log some
I have just started building app with sencha touch 2 I was trying to
I'm building an example app using Sencha Touch 2 and PhoneGap. Originally it was
I'm building an application using sencha touch 1.1 in the client side and WCF
We are building an application using Sencha Touch 1.1 and PhoneGap 1.3.0 for deployment

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.