系统、网站、API站点,简单高效开发

平台介绍 >> js/jsfun/fnSession.js Session对象操作

js/jsfun/fnSession.js Session对象操作

    let key = "sesseion_key"
    console.log("session值:", fnSession_get(key))

    console.log("设置Session值,字符串:", fnSession_set(key, fnTime_timestamp()))
    console.log("session值:", fnSession_get(key))
    console.log("设置Session值,数字:", fnSession_set(key, 123))
    console.log("session值:", fnSession_get(key))
    console.log("设置Session值,字符串:", fnSession_set(key, 132.456))
    console.log("session值:", fnSession_get(key))
    console.log("设置Session值,布尔:", fnSession_set(key, true))
    console.log("session值:", fnSession_get(key))
    console.log("设置Session值,字符串数组:", fnSession_set(key, ["aaaa", "测试"]))
    console.log("session值:", fnSession_get(key))
    console.log("设置Session值,对象:", fnSession_set(key, {"title": "标题AA", "time": fnTime_timestamp(), "list": ["aaa", "bbb"]}))
    console.log("session值:", fnSession_get(key))
    console.log("cookie ID 值:", fnSession_getID())
    console.log("删除当前用户指定Session值:", fnSession_remove(key))
    console.log("删除当前用户全部Session值:", fnSession_removeAll())
    console.log("清空服务端全部的Session:", fnSession_flush())

备案号:闽ICP备20003806号     厦门市湖里区陈朝能网络技术工作室