Ethan22;10980460 wrote:several told me before sessions have more timeout problems than regular cookies
A session will only "timeout" in the sense that PHP's session garbage collector (GC for short) is normally used to delete unused session files on occasion. The "used" aspect is determined by a configuration value (e.g. a file has to be older than "x" seconds to be considered unused), as is how often the GC is randomly executed (given in the form of a fraction where you supply the numerator and divisor, e.g. the GC will run roughly "x/y" percent of the time, where "x" and "y" are both configurable). Anytime the session is opened, however, the file's access/modified time is updated.
In other words, if I disabled GC completely and passed the session id in the URL (versus using a cookie), I could give you a session that would last indefinitely - even if you switched browsers (but copied the URL) or computers entirely.
So no, sessions don't have any more "timeout" problems other than ones that you configure.
Ethan22;10980460 wrote:I guess the other you said is because javascript makes my head spin trying to write it and php is easier for me even with it's difficulty.
Ah, well then consider this a (very small) chance to improve your Javascript knowledge.
Ethan22;10980460 wrote:Can you tell me why javascript helps with something like this?
If I told you there were two categories of languages at hand - server-side languages and client-side languages, and I asked you which one would be best for manipulating client-side behavior, which one would you pick?
In other words, yes, I could explain why Javascript "helps" with this, but isn't the answer obvious? 😉
Ethan22;10980460 wrote:Since the database is in the server, javascript can't make it go any faster than php anyway can it? A bit confused on why javascript can execute things faster than php, when the database is on the server.
Again, the database has nothing to do with this. I'm suggesting you use Javascript to reload a single image, whereas you're trying to go about the route of setting cookies and refreshing an entire page just to change the source of one element on that page.