note 83184 added to function.session-set-save-handler

From: Date: Wed, 14 May 2008 17:23:44 +0000
Subject: note 83184 added to function.session-set-save-handler
Groups: php.notes 
Request: Send a blank email to php-notes+get-139375@lists.php.net to get a copy of this message
I recently implemented MySQL Database Stored Sessions, with a similar solution to those posted here. I ran into a problem where my Session seemed like it was loosing data! It turns out I had hit the length limit that a 'text' field could hold, yet the data was still de-serializing properly, and not throwing any error. Using a 'text' column is fine, but limits you to 2^16 characters (65536-1) in length, and MySQL will do extra work to allow you to do text-style searching on it. Since you will probably never write a query that selects sessions from your table based on the data that's in them... I suggest using a blob instead of text (blob stores it's data in binary format), and I would suggest going straight to mediumblob; which will allow you to store 2^24 (1.6 Million.. give or take a few) characters before you hit the wall. Hope this helps! ---- Server IP: 208.69.120.35 Probable Submitter: 66.59.110.90 ---- Manual Page -- http://www.php.net/manual/en/function.session-set-save-handler.php Edit -- https://master.php.net/note/edit/83184 Del: integrated -- https://master.php.net/note/delete/83184/integrated Del: useless -- https://master.php.net/note/delete/83184/useless Del: bad code -- https://master.php.net/note/delete/83184/bad+code Del: spam -- https://master.php.net/note/delete/83184/spam Del: non-english -- https://master.php.net/note/delete/83184/non-english Del: in docs -- https://master.php.net/note/delete/83184/in+docs Del: other reasons-- https://master.php.net/note/delete/83184 Reject -- https://master.php.net/note/reject/83184 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#139375) next »