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

  • SEARCH
  • Home
  • 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 8485349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:37:06+00:00 2026-06-10T20:37:06+00:00

In my Sencha Touch application I store some values in localStorage and they get

  • 0

In my Sencha Touch application I store some values in localStorage and they get stored just fine. Later I need to use those values for a request to a store and I need to pass those values as request headers. The code looks like the following:

Ext.define('AppName.store.storeName', {
    extend: 'Ext.data.Store',

    requires: [
        'AppName.model.modelName'
    ],

    config: {
        model: 'AppName.model.modelName',
        storeId: 'storeName',
        proxy: {
            type: 'ajax',
            url: 'http://dynamic',
            headers: {
                auth_token: localStorage.getItem('activeUserToken'),
                user_email: localStorage.getItem('userEMail')
            },
            reader: {
                type: 'json'
            }
        }
    }
});

However, both auth_token and user_email values are being returned as “undefined” when in Chrome developer tools I clearly see those values. Besides of that I access those values in many other places in my Sencha Touch application but can’t do that in the store itself.

Could anybody please tell me what I’m doing wrong?

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-10T20:37:07+00:00Added an answer on June 10, 2026 at 8:37 pm

    I’ve solved this problem in the following way. Instead of passing the headers in the store I’m passing the headers during the request, before loading the store. Here’s the code for that:

        Ext.getStore('storeName').getProxy().setUrl(someURL);
            
        Ext.getStore('storeName').getProxy().setHeaders(
             {
                 "auth_token" : activeUserToken,
                 "user_email" : userEmail
             }
        );
    
        Ext.getStore('storeName').load();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just working on a web application with sencha touch. I need to implement
I'm trying to build Sencha Touch 2 application for production, but get an error.
I am trying some basic application on Sencha Touch 2. Instead of json ,
I have a MVC Sencha Touch application I'm building and am having some issues
I have the following Store declared in my sencha touch application Ext.define('Sample.store.ImageStore', { extend:
everyone! I need this layout position for my application in Sencha Touch 2. Code
I am new to Sencha Touch framework. I need to load some data from
I try to display some data in my Sencha touch application, but it doesn't
I develop a sencha touch application. Its working fine. Now i want to deploy/
I want to deploy the sencha touch application to native Android (apk) but when

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.