开发者

do i use ci_sessions to store session data

开发者 https://www.devze.com 2023-01-17 10:02 出处:网络
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_sessiondatabase.By follow

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 开发者_如何学Gomethod 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, i.e. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消