Use sessions without cookies

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Frederick
Forum Newbie
Posts: 13
Joined: Fri Nov 15, 2002 9:42 am

Use sessions without cookies

Post 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!
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post 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
Frederick
Forum Newbie
Posts: 13
Joined: Fri Nov 15, 2002 9:42 am

Post 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.
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

sorry i cant be a bigger help, and my the force be with you
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post 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.
Post Reply