Page 1 of 1

Use sessions without cookies

Posted: Sat Jan 17, 2004 2:44 pm
by Frederick
Hi,

I currently have a script using sessions. I do understand that if the server cannot set a cookie on a web browser that PHP sees this and manipulates the HTML to include a hidden POST filed so that the form data is always being POSTed and stored in the server sessions.

The question:
Is there a way to prevent the server from trying to set that first cookie? Im developing a script that may have privacy implications (dont ask :-) ) and we may not want to use cookies but because of the complexity of the script we have to use sessions.

thanks!

Posted: Sat Jan 17, 2004 4:53 pm
by dull1554
hmmmmm, you pose a very good question, i think there is a way of manipulating what the server does, but then again a server is like a person, their all different

Posted: Sat Jan 17, 2004 6:17 pm
by Frederick
I though it might be a conguration in the php.ini file but Im not going to dive into that before I try to see if there is an option via coding it into the script.

Posted: Sat Jan 17, 2004 6:53 pm
by dull1554
sorry i cant be a bigger help, and my the force be with you

Posted: Sat Jan 17, 2004 9:43 pm
by DuFF
Yes, you will have to change the php.ini:

session.use_cookies

Just set that line to 0.

You can also set it using ini_set, but there are sometimes problems using this function. Also, you will have to set it in every script because the ini setting goes back to default at the end of the script.