简体   繁体   中英

do i use ci_sessions to store session data


Im developing site for a travel site, in the process when a user searches I do manipulation on the database result then store it in session. Which stores the data in the ci_session database. By following this method I'm able to easily filter the data from

$this->session->userdata();

A normal search which results in 4 hotels the session data goes more than 20kb, in actual server environment it is possible that the result will be more than 200 hotels, ie 4000kb data for a single user on each row, in ci_session table.

this process is making the app very slow, What other approach i can follow to make the search result much faster.

You can store the session data in your database. CI Sessions have the ability to handle that. No need to do it yourself.

Read the chapter in the manual how to configure it properly. Choose wisely what you write into the "session" since lots of sessiondata in the database could make the requests slow if you need them on every site.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM