php - ajax - starting and ending sessions with onload and onunload -


i have signup page.

on page, user input values checked asynchronously php backend against tables.

my problem data model objects large; wise start session via ajax when enters page (onload), caches model objects other ajax requests client don't end recreating data model objects every request. when user navigates away page (onunload or whatever) ajax request send destroy session.

it seems idea me because every asynchronous request made result of user interaction form doesn't recreate objects have been created before hand.

would work in practice?

(for details of worries see comments)

update:

the main issue raised create dangling session. fixed putting simple 5 minute timeout on session?

for wondering, proved unbearably horrible idea. alright in principle managing sessions , making sure stays synchronous front end near impossible , in no way scalable, in turn made controller structure complicated nightmare debug (not mention had clear browser cache every time updated development repo.. ). managed wasted lot of time , caused me miss crucial deadlines , massive effort tiny overhead.

please don't try this.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -