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 9185377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:15:43+00:00 2026-06-17T19:15:43+00:00

In our app we rely on the sessionStorage for persistence. However on mobile Safari

  • 0

In our app we rely on the sessionStorage for persistence. However on mobile Safari the sessionStorage is not available when browsing in private mode.

However, for those customers using Safari in private mode it’s ok to switch to an in-memory approach. Our app continues to be usable to some extend (you will lose data when you refresh the browser but since it’s a single page application you never have to refresh anyway).

The fix was quite easy to do in development mode. However, after running a production build I faced a huge problem.

So, code is worth a thousand words. Here is what we currently use:

index.html

//...
<script type="text/javascript">
    var isSessionStorageAvailable = true;
    var storage =  window.sessionStorage;
    if (typeof window.sessionStorage == 'undefined' || window.sessionStorage === null) {
        isSessionStorageAvailable = false;
    } else try {
        storage.setItem('__ccTest', '__ccTest');
    } catch (err) {
        isSessionStorageAvailable = false;
    }

</script>

<script id="microloader" type="text/javascript" src="../sencha/microloader/development.js"></script>
//...

myStore.js

Ext.define('App.store.Quote', {
extend: 'Ext.data.Store',
requires: ['App.model.QuoteItem','Ext.data.proxy.SessionStorage'],

config :{
    model: 'App.model.QuoteItem',
    autoLoad: true,
    autoSync: true,
    identifer: 'uuid',
    proxy:{
        type: isSessionStorageAvailable ? 'sessionstorage' : 'memory',
        id:'ccCart'
    }
},
//...

So, before sencha get’s loaded we first check for the sessionStorage and set a global variable. So at the time when the store file loads the right configuration is picked up.

However, I really dislike this solutions as I had to alter the index.html file. In development mode you can just write this check anywhere in the app.js file because all the other files are loaded afterwards. But in production that’s not the case. So I wonder how would you do that properly without altering the index.html file?

UPDATE

I also tried to use the applier like this:

applyProxy: function(proxy, oldProxy){

    proxy.type = 'sessionstorage';
    var storage =  window.sessionStorage;
    if (typeof window.sessionStorage == 'undefined' || window.sessionStorage === null) {
        proxy.type = 'memory';
    } else try {
        storage.setItem('__ccTest', '__ccTest');
    } catch (err) {
        proxy.type = 'memory';
    }

    this.callParent([proxy, oldProxy]);
}

However, the first time some code calls sync() on this store it raises an error inside the sencha framework:

It’s inside the sync method of the store class on this line (it’s from the minified source, sorry):

d.getProxy().batch({operations: b,listeners: d.getBatchListeners()})

It raises an error because getProxy() returns undefined. So it seems as if the applier didn’t work :(.

  • 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-17T19:15:44+00:00Added an answer on June 17, 2026 at 7:15 pm

    Use the applier…

    Ext.define('App.store.Quote', {
        extend   : 'Ext.data.Store',
        requires : ['App.model.QuoteItem', 'Ext.data.proxy.SessionStorage'],
    
        config : {
            model     : 'App.model.QuoteItem',
            autoLoad  : true,
            autoSync  : true,
            identifer : 'uuid',
            proxy     : {
                id : 'ccCart'
            }
        },
    
        applyProxy : function (config, oldProxy) {
            config.type = isSessionStorageAvailable ? 'sessionstorage' : 'memory';
    
            return this.callParent([config, oldProxy]);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking to create a mobile version of our website/web app. What's a good
Can we rely on our Android app getting a set amount of memory or
Our app works fine on iOS 4.2 and 4.3. However, on iOS 3.2 it
Our mobile app communicates with a back end API. We want to be able
A portion of our app uses code generated using CodeDom. This code does not
our app got rejected, becouse the app does not rotate in upside down orientation.
Our app (before authentication) has Customers and Widgets. As you'd expect each customer has
Our app uses a component that requires a license file in the directory with
Our app runs in jvm 32 bit, even when in windows x64. Now, at
Our app servers (weblogic) all use log4j to log to the same file on

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.