Welcome Guest, Not a member yet? Register   Sign In
New Session Row Inserted After Session Flash Used
#1

[eluser]Refringe[/eluser]
Is it normal for CI to insert a new row in the session table after a session flash variable is used? I would have thought the old row's session_id and user_data could just be updated, instead of creating another row in the table.

Not a big deal I suppose, because of the built-in garbage collector, but why make more garbage then you have to?

Thoughts?
#2

[eluser]BrianDHall[/eluser]
I think this is part of how flash data is fundamentally handled differently than regular session data. As such I presume they kept them separate to ease the garbage collector design and to help eliminate the possibility to flash data causing a deletion of data that should not be deleted.
#3

[eluser]marinaccio[/eluser]
I have been working through this for the past couple of days with a flash uploader (swfupload)...

Problem:
When using either CI sessions or native PHP sessions and a flash component is used, the current session is destroyed. The flash component will request a new session, as it doesn't account for any active session. In turn, your CI/PHP session is destroyed, and a new session created... Lots of headache if you are using sessions for authentication, etc.

Resolution: <- Worked for me, no guarantee...
In your Session library, where you call $this->_sess_run();
Replace/wrap that call like so:

if (! stristr($this->object->input->user_agent(),'shockwave')) {
$this->_sess_run();
}

I don't remember exactly where I got this from, as I had been all over the web and back, but hope it does others with a similar problem some good.

-Joe
#4

[eluser]Refringe[/eluser]
@marinaccio:
I think there may be a little confusion here. By "session flash variable" I meant the CI built-in session library's "flashdata" functions.

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

[eluser]marinaccio[/eluser]
I overlooked that, sorry for the confusion. If you ever deal with Flash and sessions, above is the fix that worked for me. Not sure with flash data, if I run into it, I'll post what I got. Have a good weekend.

-Joe




Theme © iAndrew 2016 - Forum software by © MyBB