Hi guys n gals;
I'm playing with sessions at the moment and it's a PIA to get my head around.😕
I have the following snippet in form.php:
<?php
session_start();
// prevent page caching in PHP:
header('Cache-Control: no-cache, no-store, must-revalidate'); //HTTP/1.1
header('Expires: Sun, 01 Jul 2005 00:00:00 GMT');
header('Pragma: no-cache'); //HTTP/1.0
/* if (!session_start()) {
die("Session failed to start!"); }
*/
?>
I understand the part about headers already sent: The question is, HOW can I combine the two things? And yes I know they're out of order if they did work, but as shown throws only the Headers Already Sent message instead of a bunch of Notices and Warnings. And besides I know the session is working or the first section of code wouldn't work.
How do I get both parts, including the commented out part, to work?
Why would a session fail to start? That would be a server issue, would it not? Nothing to do with the coder or visitor? LOL, assuming the coder did his job right!
But since I can envision other circumstances where I may want to use two or more, how would I do it?
Sorry for the dumb Q! :o