From e7666b0448f338bef1213424f9e7b036d82d9b10 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 12 Jul 2016 22:21:49 +0900 Subject: [PATCH] docs: options of session.fromPartition --- docs/api/session.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/api/session.md b/docs/api/session.md index 78b001fdab17..91ff30ad6ae4 100644 --- a/docs/api/session.md +++ b/docs/api/session.md @@ -20,17 +20,25 @@ const ses = win.webContents.session The `session` module has the following methods: -### session.fromPartition(partition) +### session.fromPartition(partition[, options]) * `partition` String +* `options` Object + * `cache` Boolean - Whether to enable cache. -Returns a new `Session` instance from `partition` string. +Returns a `Session` instance from `partition` string. When there is an existing +`Session` with the same `partition`, it will be returned; othewise a new +`Session` instance will be created with `options`. If `partition` starts with `persist:`, the page will use a persistent session available to all pages in the app with the same `partition`. if there is no `persist:` prefix, the page will use an in-memory session. If the `partition` is empty then default session of the app will be returned. +To create a `Session` with `options`, you have to ensure the `Session` with the +`partition` has never been used before. There is no way to change the `options` +of an existing `Session` object. + ## Properties The `session` module has the following properties: