Page 6 of 6

Posted: Wed Jul 23, 2003 3:11 am
by m3mn0n
Holy crap what a long thread.

Anyway, wouldn't using cookies be so much easier?


php.net/setcookie

Posted: Wed Jul 23, 2003 3:30 am
by Marco van Wijngaarden
i don't have anything running myself with this host, i found out too late that this host wasn't running the latest php version actually, so now i am kinda stuck with them! Anyway, it's a Windows 2000 hosting account, they have asp as their priority i guess... i want to look into setting up an Access DB, but then again... i am new to all this... so i want to get this going before i go any further...

But what's your point asking?

Posted: Wed Jul 23, 2003 5:05 am
by Marco van Wijngaarden
Something came to my mind, i don't understand the way session works exactly, even after reading all the stuff over and over...but this is what came to me:

Now i open my page like this:

Code: Select all

<?php 
session_start(); 
header("Cache-control: private");
then, depending on the switch, the script will continue with session_register here (for example):

Code: Select all

session_register('klantgegevens'); 
        startpage(); 
        page1(); 
        break;
Now, first of all, why should i name these sessions differently in every step since i am referring to session variables all over the page as if they are global, but i've registered sessions with 8 different names in the end...
so shouldn't i refer to those different sessionnames in order to get my variable values?

But basicly, my theory is more like: i need to update (or add new variables to) the session instead of registerring a different one, right?
I assume this is the base of my current trouble??!!

I prefer to work as secure as possible, so globals (for security reasons) and cookies (for reliability) are better not to be used i guess?

Posted: Wed Jul 23, 2003 6:21 am
by m3mn0n
Cookies are more secure than sessions if both are in non-secure encryped environments. People may have different opinions but from personal experience I think cookies are so much better. But for your particular case, it doesn't really matter. But the simplicity of cookies should be utilized IMHO.

Especially for a simple task such as this.

btw have you thought about using just post vars to do this? Or just plain send the mail on the 2nd page instead of involving a 3rd?