Welcome Guest, Not a member yet? Register   Sign In
Flashdata and session in database
#1

[eluser]GrimReaper[/eluser]
Hi,
I use dx_auth for my form validation and put CI session in the database, the problem is: flashdata was stored in the database too. Is there any workaround to solve this problem? because I don't want to hit my database everytime I read/write the flashdata.

I can use PHP session to replace CI flashdata, create a function to read and delete PHP session after read, but my PHP session will be deleted only after I read it.

Thanks.
#2

[eluser]Sbioko[/eluser]
Use Caching, or I didn't understand you :-)
#3

[eluser]GrimReaper[/eluser]
Hahaha..., I'm so sorry,
sometimes I myself didn't understand what I'm typing in forum. Too many bugs in my English language and there's no debugger for that :red:

If I set
Code:
$config['sess_use_database'] = TRUE;
automatically flashdata will be stored in database too, right?

I need to save CI session data to a database, but I don't want CI flashdata stored in database. Can I do that?
#4

[eluser]Peng Kong[/eluser]
CI's session is designed to store both userdata and flashdata in either cookie or database.
unless you design you own implementation or extend ci's session heavily that the way it's gonna work.
does your app seriously read/write that much flashdata causing a performance hit?

do some benchmarking before you decide to write your own flashdata implementation. maybe you really don't have to use flashdata that way.
#5

[eluser]GrimReaper[/eluser]
Thanks for the answer.
I use flashdata to send a success/error message in my member control panel page and try to reduce unnecessary read/update query to avoid 'Too many connections' error in MySql server (share webhosting).
It looks like I can't use flashdata in my site right now.




Theme © iAndrew 2016 - Forum software by © MyBB