Hi,

We have made a single page Sencha touch app using Sencha touch 2.4.1 beta with Sencha cmd 5.0.2 . On entering the credentials we hit an api and get response. On successful login we have to display another view. If i deploy the whole code directly in tomcat, I am able to access Global variables present in app/config/Runtime.js. But when i build the app with Sencha cmd , and then deploy it gives error in the code where i am accessing the variable.
I tried the variables in Runtime.js withing the config tag so that their getter and setter are generated. But again after building my app, it gives error in accessing the variable's getter.
In Login.js i am accessing sessionCookie variable in method decodeLoginData
console.log('1 :: '+ MyApp.config.Runtime.sessionCookie);
console.log(MyApp.config.Runtime.sessionCookie);
These lines gives error
Uncaught TypeError: Cannot read property 'sessionCookie' of undefined

Below is my Login.js controller
Code:
var loginController = undefined;


Ext.define('MyApp.controller.Login', {
    extend : 'Ext.app.Controller',
    xtype: 'logincontroller',
    requires: [
        'MyApp.config.Runtime',
    ],
    config: {
        refs: {
             'loginController': 'logincontroller',         'loginScreen': 'loginscreen',
        },
        control: {
            'loginScreen': {
                initialize: 'showLoginScreen'
            },
            'loginButton': {
                tap: 'login'
            },
        },
    },


    launch: function() {
        loginController = this;
        this.login();
    },
showLoginScreen: function() {
        var orientation = Ext.Viewport.getOrientation();
        if(orientation === 'landscape') {
            this.getLoginScreen().hide();
            this.getLoginScreen().setBaseCls('login-screen-style');
        }
        else if(orientation === 'portrait') {
            this.getLoginScreen().hide();
            this.getLoginScreen().setBaseCls('login-screen-style-portrait');
        }
        this.getLoginScreen().show();
    },


    login: function() {
        var userName = this.getUserName().getValue();
        var password = this.getPassword().getValue();
        var showError = false;
        var errorMessage = '';
        console.log('Login Start');
        if (userName == '' || password == ''){
            errorMessage = 'All fields are required.';
            showError = true;
        } 
        else {
            Ext.Ajax.request({  
                url: 'http://172.16.8.98:8080/diageo/login.do',  
                method: 'POST',
                params: {
                    userName: userName,
                    password: password,
                },
                success: this.decodeLoginData,
                failure: function(response) {
                       //SS hideLoadingMask();
               },
            });        
        }        
        if(showError) {
            this.showMessageBox('Login Error', errorMessage);
        }
    },


    decodeLoginData: function(response){
        //SS hideLoadingMask();
        console.log(response);
        var responseJSON = Ext.JSON.decode(response.responseText.trim());
        
        console.log(MyApp);
        console.log('****************');
        
        
        console.log('1  :: '+ MyApp.config.Runtime.sessionCookie);
        console.log(MyApp.config.Runtime.sessionCookie);
        
        if (responseJSON != undefined){
            if(responseJSON.error != undefined) {
                loginController.showMessageBox('Login Error' , responseJSON.description);
                loginController.clearUserSession();
            } 
            else {
                MyApp.config.Runtime.setCurrentUserSession(responseJSON);
                MyApp.config.Runtime.setCurrentUserId(responseJSON.userId);
                var userName = responseJSON.firstName + ' ' + responseJSON.lastName;
                MyApp.config.Runtime.setCurrentUserName(userName);
                if(MyApp.app.getController('Login').getRememberMe().isChecked()) {
                    MyApp.app.getController('Login').saveUserSession(response.responseText, responseJSON.expiryDate);                    
                }
                console.log(responseJSON);
                MyApp.app.getController('Login').doLogin();            
            }
        }
    },


    //Login user, initialize view in Main controller
    doLogin: function() {
        var html = 'Welcome, User' ;
        this.getCostPercaseUserLabel().setHtml(html);
        this.getInventoryUserLabel().setHtml(html);
        this.getScrapAndLiquidWasteUserLabel().setHtml(html);
        this.getUserLabel().setHtml(html);
        
        this.getLoginScreen().hide({type: 'slideOut', direction: 'left'});
        
    },


    
});
This is my global Variable file Runtime.js

Code:
Ext.define('MyApp.config.Runtime', {
    singleton : true,
    //config : {
        currentApp : undefined, //The current app
        currentFactoryAppsLevel: 1, //current level in all factory apps (apps with the factory symbol)
        currentIndex: undefined, 
        rcaBackgroundWhite : false ,//Boolean for if Chart backgrounds are white for all apps
        currentUserSession : undefined, 
        currentUserId: undefined,
        currentUserName: undefined,
        currentUserSettings: undefined,
        sessionCookie : 'MyAppUserSession',
        numSubPanels : 0,
        level2Name: undefined,
        currentValueNumber : 0,
        levelData : undefined,
        viewLoadFromNotification: false,
        loginResponse: ['test'],
        
        
   // },
    /* constructor : function(config){
        this.initConfig(config);
    } */
});