php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #53713 Add sqlite3 session handler
Submitted: 2011-01-11 15:43 UTC Modified: 2017-10-24 06:13 UTC
Votes:24
Avg. Score:4.3 ± 0.9
Reproduced:18 of 18 (100.0%)
Same Version:6 (33.3%)
Same OS:6 (33.3%)
From: jinmoku at hotmail dot com Assigned:
Status: Open Package: SQLite related
PHP Version: 5.3.5 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jinmoku at hotmail dot com
New email:
PHP Version: OS:

 

 [2011-01-11 15:43 UTC] jinmoku at hotmail dot com
Description:
------------
ext/sqlite will disappear soon, it's seem good to add support for sqlite3 session handler (merge ext/sqlite/sess_sqlite.c)
;)

Test script:
---------------
session_module_name('sqlite3');

Actual result:
--------------
Warning: session_module_name(): Cannot find named PHP session module (sqlite3)

Patches

session_sqlite3 (last revision 2011-08-01 05:13 UTC by crrodriguez at opensuse dot org)
bugs-53713-sqlite3-session-win32-plus-test (last revision 2011-05-02 12:07 UTC by jinmoku at hotmail dot com)
bugs-53713-sqlite3-session.patch (last revision 2011-05-02 12:05 UTC by jinmoku at hotmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-30 04:05 UTC] jinmoku at hotmail dot com
Added patch
 [2011-08-01 05:15 UTC] crrodriguez at opensuse dot org
I have reviewed this patch, ACKed, fixed build in Unix (broken #if) and 
config0.m4

also added IF NOT EXISTS to the table creation routine.

Looks good =)
 [2012-06-29 14:52 UTC] colin at viebrock dot ca
This isn't in 5.4.4 as of yet, is it?
 [2012-06-30 00:50 UTC] felipe@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: scottmac
 [2013-04-04 23:17 UTC] dan dot latter at gmail dot com
Hi,

Any news on this? Just updated to 5.4 to update to new session shizzle and docs have lead me here as I needed a handler for sqlite3.

thanks
 [2013-06-20 21:29 UTC] krebs dot seb at gmail dot com
I wonder, why this patch isn't applied. The "looks good"-statement is two years 
old... Is scottmac even out there?
 [2013-10-12 12:18 UTC] jmshinn+php at gmail dot com
Has this issue seriously been hanging out there, fixed but not incorporated into the distribution, for 2+ years?  How is this acceptable at all?
 [2014-03-06 13:40 UTC] narf at devilix dot net
+1 in general, but I don't know if it's feasible ...

1. Sessions should be fast; trying to create a new database and/or table would slow them down.
2. I'm not sure if SQLite can handle concurrency at all.
 [2014-04-22 19:01 UTC] webmaster at tubo-world dot de
The current implementation does not use locking (the old one in https://github.com/php/php-src/blob/PHP-5.3/ext/sqlite/sess_sqlite.c did not lock either). This makes session handling fragile to race conditions, e.g. two parallel requests accessing the same session data. It results in data loss.
For this reason the files session handler locks individual sessions.

But since sqlite only supports database locking and no row locking, using locking in sqlite would mean that only one session can be read -> write at a time. Even different sessions would wait for another to finish, i.e. no parallel requests at all. So using sqlite for sessions is highly questionable. Either you have race conditions or you have no parallel requests.
 [2014-04-22 19:04 UTC] webmaster at tubo-world dot de
Locking in sqlite could be implemented using "begin immediate transaction" in read() and commiting in write() or close().
 [2017-10-24 06:13 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: scottmac +Assigned To:
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 09:01:30 2024 UTC