基于 Koa平台Node.js开发的KoaHub.js获取/设置会话功能代码
koa-session2
Middleware for Koa2 to get/set session use with custom stores such as Redis or mongodb with Babel
koa-session2
Middleware for Koa2 to get/set session use with custom stores such as Redis or mongodb with Babel
If you are not using babel in your projects, maybe you can try this version without babel.
Install
Usage
Custom Stores
Store.js
main.js
Options
Most options based on cookies
key: a string for store session id in cookiestore: a class for custom store (extend {Store}, func: #get(sid), #set(session, opts), #destory(sid))maxAge: a number representing the milliseconds fromDate.now()for expiryexpires: aDateobject indicating the cookie's expiration date (expires at the end of session by default).path: a string indicating the path of the cookie (/by default).domain: a string indicating the domain of the cookie (no default).secure: a boolean indicating whether the cookie is only to be sent over HTTPS (falseby default for HTTP,trueby default for HTTPS).httpOnly: a boolean indicating whether the cookie is only to be sent over HTTP(S), and not made available to client JavaScript (trueby default).signed: a boolean indicating whether the cookie is to be signed (falseby default). If this is true, another cookie of the same name with the.sigsuffix appended will also be sent, with a 27-byte url-safe base64 SHA1 value representing the hash of cookie-name=cookie-value against the first Keygrip key. This signature key is used to detect tampering the next time a cookie is received.overwrite: a boolean indicating whether to overwrite previously set cookies of the same name (falseby default). If this is true, all cookies set during the same request with the same name (regardless of path or domain) are filtered out of the Set-Cookie header when setting this cookie.
License
MIT
KoaHub.js -- 基于 Koa.js 平台的 Node.js web 快速开发框架

基于 Koa平台Node.js开发的KoaHub.js获取/设置会话功能代码的更多相关文章
- 基于 Koa平台Node.js开发的KoaHub.js的控制器,模型,帮助方法自动加载
koahub-loader koahub-loader是基于 Koa平台Node.js开发的KoaHub.js的koahub-loader控制器,模型,帮助方法自动加载 koahub loader I ...
- 基于 Koa平台Node.js开发的KoaHub.js连接打印机的代码
最近好多小伙伴都在做微信商城的项目,那就给大家分享一个基于 Koa.js 平台的 Node.js web 开发的框架连接微信易联云打印机接口的代码,供大家学习.koahub-yilianyun 微信易 ...
- 基于 Koa平台Node.js开发的KoaHub.js的静态服务器重写和索引代码
koa-static-server Static file serving middleware for koa with directory, rewrite and index support k ...
- 基于 Koa平台Node.js开发的KoaHub.js的模板引擎代码
koahub-handlebars koahub-handlebars koahub handlebars templates Installation $ npm install koahub-ha ...
- 基于 Koa平台Node.js开发的KoaHub.js的输出json到页面代码
koahub-body-res koahub body res Format koa's respond json. Installation $ npm install koahub-body-re ...
- 基于 Koa平台Node.js开发的KoaHub.js的跳过组件代码
koahub-skip koahub skip middleware koahub skip Conditionally skip a middleware when a condition is m ...
- 基于LBS平台的iOS开发
LBS,即Location Based Services,基于位置服务,用于定位.导航等功能,比如地图应用.订外卖等的app就需要这个功能. 在这里我使用的是高德LBS开放平台,地址:http://l ...
- 基于CkEditor实现.net在线开发之路(2)编写C#代码,怎么调用它。
上一章简约的介绍了CkEditor编辑器,可以编辑js逻辑代码,css,html,C#代码,这章我根据实际例子,讲解怎么编写C#代码和怎么调用它. 大家都还记得刚刚接触程序编时的hello Word吧 ...
- 手机开发必备技巧:javascript及CSS功能代码分享
1. viewport: 也就是可视区域.对于桌面浏览器,我们都很清楚viewport是什么,就是出去了所有工具栏.状态栏.滚动条等等之后用于看网页的区域,这是真正有效的区域.由于移动设备屏幕宽度不同 ...
随机推荐
- 随机矩阵(stochastic matrix)
最近一个月来一直在看Google排序的核心算法---PageRank排序算法[1][2],在多篇论文中涉及到图论.马尔可夫链的相关性质说明与应用[3][4][5],而最为关键,一直让我迷惑 ...
- Oracle job调用存储过程
在PL/SQL中的what值中直接写入存储过程的名称+“分号”: begin sys.dbms_job.submit(job => :job, what => 'del_ky_items; ...
- 通过数组方式向Oracle大批量插入数据(10万条11秒)
1.创建数据库Person CREATE TABLE Person( id number, name nvarchar2() , age number , sex nvarchar2() , pass ...
- Python自然语言处理学习笔记之信息提取步骤&分块(chunking)
一.信息提取模型 信息提取的步骤共分为五步,原始数据为未经处理的字符串, 第一步:分句,用nltk.sent_tokenize(text)实现,得到一个list of strings 第二步:分词,[ ...
- 一个想法(续四):IT技术联盟创业众筹进度公示
为了将整个创业过程更加的公开公正透明化,特开此篇用于展示众筹进度. 首轮众筹进度如下:(每天24点更新1次)
- MySql存储过程的使用
MySql存储过程跟sql server 有一定的区别,使用说明和步骤如下 使用说明 创建存储过程 MySQL中,创建存储过程的基本形式如下: CREATE PROCEDURE sp_name ([p ...
- 做一个项目前搭建一个tabBar(一)框架
前言 通常做一个项目前,不算开始讨论需求,分析产品等等,一开始会给我们搭建一个框架,今天简单说一下搭建框架. github网址:https://github.com/Moonths/iWatch.gi ...
- 纯js实现html转pdf
项目开发中遇到了一个变态需求,需要把一整个页面导出为pdf格式,而且要保留页面上的所有的表格.svg图片和样式.简而言之,就是希望像截图一样,把整个页面截下来,然后保存成pdf.咋不上天呢--查了一下 ...
- 【easyui】之treegrid的分页
easyui官网给的treegrid的分页是相当的复杂,我们来简化一下! 首先treegrid 分页和 datagrid一样需要设置一系列参数! 如下: depTreeGrid=$("#de ...
- 简单了解Hibernate
orm 对象 object 关系relational映射 mppingorm对象关系映射hibernate 框架是什么?很简单 持久化框架 他轻松的封装了jdbc那些繁琐的操作什么是持久化?持久化就 ...