Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customStorage 类 set() expire参数不生效 #1277

Open
V55555V opened this issue Oct 31, 2018 · 0 comments
Open

customStorage 类 set() expire参数不生效 #1277

V55555V opened this issue Oct 31, 2018 · 0 comments
Assignees

Comments

@V55555V
Copy link

V55555V commented Oct 31, 2018

BUG 描述
new CustomStorage(0); set()设置了expire,过期了但localStorage还存在。

复现步骤

define(function (require) {
    var customElement = require('customElement').create();
    var util = require('util');
    var CustomStorage = util.customStorage;
    var storage = new CustomStorage(0);
    storage.rmExpires();

    customElement.prototype.build = function () {
    	var expire =  5; //5ms,立马失效
        if (!storage.get('firstEnterUrl')) {  // 过期了就会重新获取,但没有走这步
            var refurl = document.referrer;
            storage.set('firstEnterUrl', document.URL, expire);
            storage.set('referrerUrl', refurl, expire);
        }
        storage.set('enterUrl', document.URL, expire);
    };
    return customElement;
});

期望结果
按expire设置的5ms来看,应该是每次点击都会重写三个值。但目前只有enterUrl被重写。

截图
1

环境及版本信息:
Windows10
Firefox 63.0

@VenyXiong VenyXiong self-assigned this Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants