基于 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是什么,就是出去了所有工具栏.状态栏.滚动条等等之后用于看网页的区域,这是真正有效的区域.由于移动设备屏幕宽度不同 ...
随机推荐
- HDU-1256-画8
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=1256 这题做的我好苦,开始题目理解错了,一直都不对,仔细看题,别急,慢慢来,别紧张, 难度到不大,但题 ...
- BOM总结
一.BOM概念 BOM:Browser Object Model 浏览器对象模型,定义了JS操作浏览器的一些方法和属性 二.BOM方法 (在BOM里面大部分的方法都是调用window对象下的方法得到 ...
- C# 枚举的使用
/// <summary> /// 枚举的使用 /// 主要功能:使用枚举的值DataTypeId.Money,获取对应的Money字符串. /// </summa ...
- SLS评测报告
什么是SLS? 简单日志服务(Simple Log Service,简称SLS)是针对日志收集.存储.查询和分析的服务.用户只需简单地配置日志产生的位置和格式等信息,就能实时查询海量日志,并可通过S ...
- Spring MVC整合DWR
http://blog.csdn.net/geloin/article/details/7537148 基本上与上文描述的情况一致: 在Controller中可以进行Service层的调用: 如果需要 ...
- jQuery获取、设置title的值
获取值:var t = $(document).attr('title'); 设置值:$(document).attr('title','value');
- Bootstrap入门(二十一)组件15:警告框
Bootstrap入门(二十一)组件15:警告框 通过这些简单.灵活的进度条,为当前工作流程或动作提供实时反馈. 进度条组件使用了 CSS3 的 transition 和 animation 属性来完 ...
- json-lib之复杂数据类型的转换
在json字符串转java bean时,一般的对象,可以直接转,如:一个学生类,属性有姓名.年龄等 public class Student{ private String sname; privat ...
- iOS-桥接方式
很多时候都会使用到CoreFoundation的函数,其返回值为CoreFoundation框架的对象,如果想转换为Foundation框架的对象就可以使用桥接方式来搞定. 示例代码: CFStrin ...
- 蓝桥网试题 java 基础练习 十六进制转八进制
- -------------------------------------------------------------------------------------------------- ...