• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Session problem

#1
[eluser]veledrom[/eluser]
Hi,

I have a webform which consists of 8 steps(pages). Each pages have plenty of form elements filled by user. If I try to store all those user inputs in session, it will fail cos max limit of session cookie is 4KB so what do you suggest me to use?

I'll store about 5000 characters which won't fit in a cookie.

Thanks

#2
[eluser]smilie[/eluser]
I have had same problem with 4 steps order system. Just use database sessions:

http://ellislab.com/codeigniter/user-gui...sions.html

Cheers,
Smilie

#3
[eluser]veledrom[/eluser]
Yes you're right. Using db session solved problem. It does store as plenty of data.

Code:
CREATE TABLE IF NOT EXISTS  `ci_sessions` (
session_id varchar(40) DEFAULT '0' NOT NULL,
ip_address varchar(16) DEFAULT '0' NOT NULL,
user_agent varchar(120) NOT NULL,
last_activity int(10) unsigned DEFAULT 0 NOT NULL,
user_data text NOT NULL,
PRIMARY KEY (session_id),
KEY `last_activity_idx` (`last_activity`)
);

$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'ci_sessions';


#4
[eluser]vbsaltydog[/eluser]
Unless you are allowing your eight step form to be edited at any given stage, you should be able to write the values to whatever database table that is required for each particular step without keeping all that form data in the session.

step one collects address info
(store the data in the address table)

step two collects shipping method info
(store the data in the shipping table)

that way the form data is not kept in a massive session array.

There ARE cases where you want to keep it all in a session array for easy editing before final database storage, of course.

#5
[eluser]Reneesh T K[/eluser]
I have a shopping cart site with codeigniter frame work and it was showing session out when adding morethan hundreds of products.

I have solved the issue by changing the database field type of user_data in session table.

Please check more info about it in

http://myphplibrary.blogspot.in/2012/03/...ation.html

#6
[eluser]veledrom[/eluser]
Thanks for the hint. I'll remember that if it occurs to me in future. For the current project I have holds 5000 chars so no worries. (A string with a maximum length of 65535 characters for TEXT datatype)


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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