From 20573bd472bdeaa831074e563f239585554ffaf5 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 1 Sep 2015 12:46:06 +0300 Subject: [ci skip] Correct session database setup docs --- user_guide_src/source/libraries/sessions.rst | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'user_guide_src/source/libraries/sessions.rst') diff --git a/user_guide_src/source/libraries/sessions.rst b/user_guide_src/source/libraries/sessions.rst index 2034ed2b0..9c9761bbf 100644 --- a/user_guide_src/source/libraries/sessions.rst +++ b/user_guide_src/source/libraries/sessions.rst @@ -598,7 +598,6 @@ For MySQL:: `ip_address` varchar(45) NOT NULL, `timestamp` int(10) unsigned DEFAULT 0 NOT NULL, `data` blob NOT NULL, - PRIMARY KEY (id), KEY `ci_sessions_timestamp` (`timestamp`) ); @@ -608,17 +607,23 @@ For PostgreSQL:: "id" varchar(40) NOT NULL, "ip_address" varchar(45) NOT NULL, "timestamp" bigint DEFAULT 0 NOT NULL, - "data" text DEFAULT '' NOT NULL, - PRIMARY KEY ("id") + "data" text DEFAULT '' NOT NULL ); CREATE INDEX "ci_sessions_timestamp" ON "ci_sessions" ("timestamp"); -However, if you want to turn on the *sess_match_ip* setting, you should -also do the following, after creating the table:: +You will also need to add a PRIMARY KEY **depending on your 'sess_match_ip' +setting**. The examples below work both on MySQL and PostgreSQL:: + + // When sess_match_ip = TRUE + ALTER TABLE ci_sessions ADD PRIMARY KEY (id, ip_address); + + // When sess_match_ip = FALSE + ALTER TABLE ci_sessions ADD PRIMARY KEY (id); + + // To drop a previously created primary key (use when changing the setting) + ALTER TABLE ci_sessions DROP PRIMARY KEY; - // Works both on MySQL and PostgreSQL - ALTER TABLE ci_sessions ADD CONSTRAINT ci_sessions_id_ip UNIQUE (id, ip_address); .. important:: Only MySQL and PostgreSQL databases are officially supported, due to lack of advisory locking mechanisms on other -- cgit v1.2.3-24-g4f1b From 71789ce7bb345a9d32bfa9cbf1334876647ea7e1 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 21 Jul 2016 12:45:58 +0300 Subject: Merge pull request #4716 from Ema4rl/patch-1 [ci skip] Fix Session userguide typos --- user_guide_src/source/libraries/sessions.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide_src/source/libraries/sessions.rst') diff --git a/user_guide_src/source/libraries/sessions.rst b/user_guide_src/source/libraries/sessions.rst index 9c9761bbf..082828c4e 100644 --- a/user_guide_src/source/libraries/sessions.rst +++ b/user_guide_src/source/libraries/sessions.rst @@ -906,7 +906,7 @@ Class Reference Gets a list of all ``$_SESSION`` that have been marked as "flashdata". - .. php:method:: umark_flash($key) + .. php:method:: unmark_flash($key) :param mixed $key: Key to be un-marked as flashdata, or an array of multiple keys :rtype: void @@ -971,7 +971,7 @@ Class Reference Gets a list of all ``$_SESSION`` that have been marked as "tempdata". - .. php:method:: umark_temp($key) + .. php:method:: unmark_temp($key) :param mixed $key: Key to be un-marked as tempdata, or an array of multiple keys :rtype: void -- cgit v1.2.3-24-g4f1b From 6c6ee1a1e73b3f8a93ca031107bec35e56272a0a Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 22 Oct 2016 16:33:06 +0300 Subject: Close #4830, #3649 --- user_guide_src/source/libraries/sessions.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide_src/source/libraries/sessions.rst') diff --git a/user_guide_src/source/libraries/sessions.rst b/user_guide_src/source/libraries/sessions.rst index 082828c4e..a95cd5a19 100644 --- a/user_guide_src/source/libraries/sessions.rst +++ b/user_guide_src/source/libraries/sessions.rst @@ -594,7 +594,7 @@ And then of course, create the database table ... For MySQL:: CREATE TABLE IF NOT EXISTS `ci_sessions` ( - `id` varchar(40) NOT NULL, + `id` varchar(128) NOT NULL, `ip_address` varchar(45) NOT NULL, `timestamp` int(10) unsigned DEFAULT 0 NOT NULL, `data` blob NOT NULL, @@ -604,7 +604,7 @@ For MySQL:: For PostgreSQL:: CREATE TABLE "ci_sessions" ( - "id" varchar(40) NOT NULL, + "id" varchar(128) NOT NULL, "ip_address" varchar(45) NOT NULL, "timestamp" bigint DEFAULT 0 NOT NULL, "data" text DEFAULT '' NOT NULL -- cgit v1.2.3-24-g4f1b From 24fedeb2075194f0da475f45f400a0866d9577f9 Mon Sep 17 00:00:00 2001 From: klemens Date: Mon, 16 Jan 2017 21:01:58 +0100 Subject: spelling fixes --- user_guide_src/source/libraries/sessions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/libraries/sessions.rst') diff --git a/user_guide_src/source/libraries/sessions.rst b/user_guide_src/source/libraries/sessions.rst index a95cd5a19..b1f658d8f 100644 --- a/user_guide_src/source/libraries/sessions.rst +++ b/user_guide_src/source/libraries/sessions.rst @@ -471,7 +471,7 @@ Preference Default Description .. note:: The 'cookie_httponly' setting doesn't have an effect on sessions. Instead the HttpOnly parameter is always enabled, for security - reasons. Additionaly, the 'cookie_prefix' setting is completely + reasons. Additionally, the 'cookie_prefix' setting is completely ignored. Session Drivers -- cgit v1.2.3-24-g4f1b