I would suggest you store first the name of the file to play in localstorage and then read the name of the file from localstorage to play it. if the person for some reason disables localstorage they won't hear the sound... which is probably better than annoying someone every single time because they turned off localstorage permissions.
On Saturday, October 25, 2014 11:25:46 AM UTC-7, LoveWeb2py wrote: > > Thank you, Massimo. I'll look into that. First time I've heard of html5 > local storage. > > On Friday, October 24, 2014 12:48:14 AM UTC-4, Massimo Di Pierro wrote: >> >> I would do this all in JS. You play the file then store in a html5 local >> storage a flag that says you played it. Next time you check the >> localstorage. No reason to bother the server with this information. >> >> http://www.w3schools.com/html/html5_webstorage.asp >> >> On Thursday, 23 October 2014 20:18:38 UTC-5, LoveWeb2py wrote: >>> >>> Hello, >>> >>> I would like to greet or user with a sound one time upon accessing a >>> controller but if they click it again i would want the sound to play again >>> while they're logged in. However if they log out and log back in I would >>> like it to play again. What type of logic should I use sessions or >>> cookies? What is av better fit. >>> >> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.