• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using session ID as foreign key for temporary rows, too volatile since 3.x?

#1
We are using the session ID to piggyback off of the session GC. Search results have a column linking them to the current session, the idea was to have the user have access to those rows during his session and when the sessions get cleaned so do the search results. This has worked pretty well in CI2.x the past years, but since upgrading to 3.x the session ID seems to be more volatile and it changes during a request, before being added to the sessions table (causing foreign key errors when inserting)
I'm starting to think this is not a reliable value to link to anymore.

Can we utilise the 'sess_time_to_update' config setting to get the desired behaviour or should I start investigating a different way of tracking "while a user is logged in"? (FYI we use Ion_auth for authentication)

Thanks in advance,
Alex
Reply

#2
Why not just create your own id and store it in the session?
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
(09-14-2018, 04:13 AM)InsiteFX Wrote: Why not just create your own id and store it in the session?

I could, but I'd have to do my own garbage collection instead of being able to rely on foreign key rules.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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