[SOLVED] session 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
patch2112
Forum Commoner
Posts: 86
Joined: Sun Oct 31, 2004 9:44 am
Location: London

[SOLVED] session cookies

Post by patch2112 »

Hello all, pulling out my hair and I don't have much left. I'm trying to keep php from appending the SID to the URL and require that the session cookie was set.

I've tried everything I can find...

1. Set session.use_only_cookies=1 in php.ini, but the setting wasn't there. I added it manually and it still didn't work.

2. Set session.use_coolies = 1 in php.ini

3. Set session.use_trans_sid = 0 in php.ini

I even tried adding
ini_set('session.use_only_cookies',1); prior to any session_starts and that didn't work either, I still am getting the damn url appended.

Here is the php.ini boiled down to session stuff

Code: Select all

variable in order to use PHP's session functions.
session.save_path = /tmp; 

Whether to use cookies.
session.use_cookies = 1; 

My entry.
session.use_only_cookies = 1;

Name of the session (used as cookie name).
session.name = PHPSESSID; 

Initialize session on request startup.
session.auto_start = 0; 

Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0; 

The path for which the cookie is valid.
session.cookie_path = /; 

The domain for which the cookie is valid.
session.cookie_domain =; 

use transient sid support if enabled by compiling with --enable-trans-sid.
session.use_trans_sid = 0;

url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
їMSSQL] ;
Any thoughts?

Thanks, Philip
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Do you use some 3rd part scripts? Asking because some CMS's/boards enable the SID even though you do not want to. Or at least simulate it.

Dumb question, but did you restart the httpd daemon? :roll:

I have the same settnigs as you on a couple of computers, and I have no issues with this...
patch2112
Forum Commoner
Posts: 86
Joined: Sun Oct 31, 2004 9:44 am
Location: London

Thanks

Post by patch2112 »

There aren't any dumb questions, only dumb people.

I'm still very new and self teaching, so I'll forgive myself this time.

Thanks for the help,
Philip
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Meaning... what?
You did forget to restart the httpd?

Just making sure so that other readers might get a hint on what the need to do if they have the same issues.
patch2112
Forum Commoner
Posts: 86
Joined: Sun Oct 31, 2004 9:44 am
Location: London

Answer

Post by patch2112 »

I was hoping to save a little dignity, but just so all the world can see...

I'm an idiot and didn't restart apache.
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Sorry for making you crawl in the dirt... :lol:
I can assure you, that we've all more likely done this more than once ourselves.

Glad it works!
patch2112
Forum Commoner
Posts: 86
Joined: Sun Oct 31, 2004 9:44 am
Location: London

thanks

Post by patch2112 »

lol,

Glad it works too, thanks again for your help!

Washing and recovering,
Philip
Post Reply