ajax - Separating PHP session variables into their own files -


i thinking writing session handler (using session_set_save_handler) stores each session variable in it's own file. maybe have session_id directory, , each variable stored in own file, session key filename.

my purpose is:

  • non-blocking (or lesser-blocking) session. i.e. when run script opens session, don't have close session before script can write session. thinking session handler can open , close single file write access (read access ok because can close session , still access values using $_session). write given session variable, script won't need lock entire session.
  • the application quite database heavy (it's central database biology research lab) hence why don't want put load on database storing user's sessions in database (although alternative, maybe set additional database sessions?). sessions used fair bit user's form inputs saved session using ajax (on change, persistence) , there can multiple instances of given form.
  • facilliate garbage collection / expiry routines on sessions without over-locking

does have opinion on storing sessions this? idea? bad idea?

i suggest avoid writing , implement solution has been tried , tested.

the following solution meets criteria set out in question:

http://silex.sensiolabs.org/doc/cookbook/session_storage.html

i recommend if application quite database heavy have stated, create separate database purely storing , reading sessions have acknowledged already.

in order set have download silex uses symfony2 components. recommend best way silex set on website use composer. brevity not cover installing , setting composer there lots of useful articles on how this.

you don't have make use of comes silex if choose go down route having silex class library beneficial other uses too.

instructions setting silex can found @ following location:

http://silex.sensiolabs.org/doc/usage.html

the following link provides more information on configuring sessions along example on how use them, mentioned on page file storage used, can ignore relating file storage:

http://silex.sensiolabs.org/doc/providers/session.html

despite meeting requirements have specified, if recommended solution not consider please explain why , provide additional , support required.


Comments

Popular posts from this blog

How to run C# code using mono without Xamarin in Android? -

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -