Welcome Guest, Not a member yet? Register   Sign In
Session element limit
#1

[eluser]wollesen[/eluser]
Hello there.

I am building a application in Codeigniter and i am very pleased with Codeigniter so far.

I have integrated HybridAuth, a login layer for social networks, which is working fine.

It gets the user information from the social netword and i store it in my DB as well as the CIs session.

Now, my problem is, if i have more then 7 custom elements (standard key value, nothing nested) in my session array, it wipes itself clean on the next page redirect and gives me a shiny new session array with only standard values.

Now, is this how it works? Did i do something to be this way? Is there a way to get more room to play with?

Thanks in advance, Rasmus W.

P.s. no, it is not huge chucks on data. The entire array is 2 lines long on a 17" screen, so i seriously doubt that would break the 4kb limit of a session.
#2

[eluser]CroNiX[/eluser]
What mechanism are you using to store your session data? Cookies (default) or database?
#3

[eluser]wollesen[/eluser]
Cookies
#4

[eluser]CroNiX[/eluser]
Cookies have a size limit per cookie. RFC2109 states it is 4k. Some browsers will do more, but not guaranteed in all browsers. For this, it's usually better to use the database to store sessions.
#5

[eluser]wollesen[/eluser]
Yup and 4k should be more then plenty to store just a little bit more then 7 elements of small text bits.

This is my session array at the moment, with the max allowed 7 elements

Array ( [session_id] => a6d9c2982397076b30276dc1fe5fa0a3 [ip_address] => 94.191.184.57 [user_agent] => Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36 [last_activity] => 1386190664 [user_data] => [home] => [firstname] => Rasmus [surname] => Wollesen [email] => mail@ofir.dk [username] => Rasmus Wollesen [userAccount] => Rasmus Wollesen [isLoggedIn] => 1 )

I am just wondering if it is right that i can only store this amount or did i make an error somewhere to limit it?
#6

[eluser]wollesen[/eluser]
It would seem that if i use nested arrays in the session var i can store whatever i want, so that should fik the problem




Theme © iAndrew 2016 - Forum software by © MyBB