• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Session size with database driver

#1
Hello,

just information post. I miss information in CI documentation about session data size with database driver.

In session database schema is used BLOB type. That means, there is only 64 KB storage space. If you need more, then MEDIUMBLOB is needed (16 MB).

If session size is exceeded, then you get this error:
Severity: Warning --> session_start(): Failed to decode session object. Session has been destroyed /libraries/Session/Session.php
Reply

#2
The community has known about this for ages now going back to CodeIgniter 1.7.0
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#3
(08-25-2017, 04:13 AM)punjab Wrote: Hello,

just information post. I miss information in CI documentation about session data size with database driver.

In session database schema is used BLOB type. That means, there is only 64 KB storage space. If you need more, then MEDIUMBLOB is needed (16 MB).

If session size is exceeded, then you get this error:
Severity: Warning --> session_start(): Failed to decode session object. Session has been destroyed /libraries/Session/Session.php

If you have 64kb of session data, you are 100% doing something wrong.

(08-26-2017, 05:09 AM)InsiteFX Wrote: The community has known about this for ages now going back to CodeIgniter 1.7.0

Um, no ... the community knew about the 2kb limit of cookies, when that was the primary session storage.
Reply

#4
(08-28-2017, 01:41 AM)Narf Wrote: If you have 64kb of session data, you are 100% doing something wrong.

Lol - I thought that too when I read this question.

@Punjab
64k is about thirty pages of text - a small book - wtf!!!! What on earth are you storing in your session to use up 64k?
Reply

#5
(08-28-2017, 01:41 AM)Narf Wrote:
(08-25-2017, 04:13 AM)punjab Wrote: Hello,

just information post. I miss information in CI documentation about session data size with database driver.

In session database schema is used BLOB type. That means, there is only 64 KB storage space. If you need more, then MEDIUMBLOB is needed (16 MB).

If session size is exceeded, then you get this error:
Severity: Warning --> session_start(): Failed to decode session object. Session has been destroyed /libraries/Session/Session.php

If you have 64kb of session data, you are 100% doing something wrong.

(08-26-2017, 05:09 AM)InsiteFX Wrote: The community has known about this for ages now going back to CodeIgniter 1.7.0

Um, no ... the community knew about the 2kb limit of cookies, when that was the primary session storage.

@Narf

If you search the forms you will see that I had mentioned showed how to use the different text sizes with the old sessions.

But then they may have been deleted.

Old Link: Text Sizes
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#6
(08-28-2017, 06:20 AM)InsiteFX Wrote:
(08-28-2017, 01:41 AM)Narf Wrote:
(08-26-2017, 05:09 AM)InsiteFX Wrote: The community has known about this for ages now going back to CodeIgniter 1.7.0

Um, no ... the community knew about the 2kb limit of cookies, when that was the primary session storage.

@Narf

If you search the forms you will see that I had mentioned showed how to use the different text sizes with the old sessions.

But then they may have been deleted.

Old Link: Text Sizes

Fun fact: It didn't matter if you stored CI2 sessions in a database or not; the data was always stored into and read from the cookie anyway.

That's one of the horrible reasons why the library was rewritten.
Reply

#7
(08-28-2017, 08:37 AM)Narf Wrote:
(08-28-2017, 06:20 AM)InsiteFX Wrote:
(08-28-2017, 01:41 AM)Narf Wrote:
(08-26-2017, 05:09 AM)InsiteFX Wrote: The community has known about this for ages now going back to CodeIgniter 1.7.0

Um, no ... the community knew about the 2kb limit of cookies, when that was the primary session storage.

@Narf

If you search the forms you will see that I had mentioned showed how to use the different text sizes with the old sessions.

But then they may have been deleted.

Old Link: Text Sizes

Fun fact: It didn't matter if you stored CI2 sessions in a database or not; the data was always stored into and read from the cookie anyway.

That's one of the horrible reasons why the library was rewritten.

True,

But at least now most of he newer web browsers have larger cookie storage size.
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#8
It actually differs between vendors, but it's still about 4kb (me saying 2kb was incorrect) including all Set-Cookie attributes and not just the value. See the official standard and note that it uses the word "SHOULD" there, meaning that it's not a hard requirement and thus any browser could potentially break any of the recommendations.

But that's irrelevant either way.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.