note 83184 deleted from function.session-set-save-handler by danbrown

From: Date: Sun, 23 Jan 2011 16:14:55 +0000
Subject: note 83184 deleted from function.session-set-save-handler by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-176030@lists.php.net to get a copy of this message
Note Submitter: dmclain at expressdynamics dot com ---- 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!

« previous php.notes (#176030) next »