Welcome Guest, Not a member yet? Register   Sign In
cart class cookie size
#1

[eluser]Ngulo[/eluser]
hi all guys,

i'm using cart class but i can't insert more then 4 products inside.

cause the cookie became 4kbs as max size.

any suggestion?

i do not use cart db only session class cart.
#2

[eluser]WanWizard[/eluser]
There is no solution, the 4Kb limit is a browser limit, no way to expand that size.

From a security point of view it's not wise to store user data client side. If you don't like database sessions, use one of the third party libraries available that use alternative storage.
#3

[eluser]Ngulo[/eluser]
thanks wanwizard i'm just fixing all my problems using db for sessions.
but what are main alternative storage libraries yo are referring? :Smile

and.... only one last question.... how to make CI NOT update session data?

i use in config file:
$config['sess_cookie_name'] = 'sess_id';
$config['sess_expiration'] = 0;
$config['sess_encrypt_cookie'] = TRUE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'ci_session';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = FALSE;
$config['sess_time_to_update'] = 0;

is this the way to have sessions always not updated?

thanks Wink
#4

[eluser]WanWizard[/eluser]
There are some third party libraries around that are drop-in replacements for the session library, notably native_sessions (that uses a file for each session). See the wiki.

I don't see what the problem is with session update. As long as the session is valid, the same record is updated. Only after the session is expired a new session record is created. You have to think about a proper session expiration time for your application.

If you set sess_expiration to 0, the session library with set it to two years. CI 1.7.2. doesn't support 'expire on browser close', CI 2.0 does.
If you set sess_time_to_update to 0, it will rotate the session id on every request, which is a bit over the top...

Note that if you now have an issue with to many session records, switching session libraries won't help, they will create the same amount of sessions, just on a different storage medium.
#5

[eluser]Ngulo[/eluser]
thanks !!

i noticed that for ajax request if session ends to 5minutes for exmpaple and i make an ajax request,
request comes and session is not the same...

hope understand my bad english.


is just an ajax problem fro me.
#6

[eluser]WanWizard[/eluser]
You have to prevent session id rotation on AJAX requests.

This has been discussed a million times before, search the forum for sess_update and IS_AJAX.




Theme © iAndrew 2016 - Forum software by © MyBB