session.auto_start does not work 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
xsaero00
Forum Newbie
Posts: 6
Joined: Mon Sep 19, 2005 6:23 pm

session.auto_start does not work without cookies.

Post by xsaero00 »

When we started developing our site the session did not need to be enabled on every page. Now after a while it is being used on almost every page, so I want to use session.auto_start instead of starting session every time explicitly.
We want to accomodate people who use cookies and those who don't. The session.auto_start works fine with cookies but once you start blocking cookies it stops working. The urls on the page do not get rewritten to include session ids. The directive session.use_only_cookies is set to 0. When I dont use session.auto_start everything works and urls do get rewritten when cookies are disabled.

I serched net for this problem and found nothing. Please help. :(
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Try setting session.use_trans_sid to 1.

However, I recommend rethinking how your application is structured and using a common include file to start the session.
xsaero00
Forum Newbie
Posts: 6
Joined: Mon Sep 19, 2005 6:23 pm

Post by xsaero00 »

We are using a common include that starts the session. But because this include does more that just start session it is ommited on some sceleton pages which also use session. I thought instead of refactoring I could eliminate session start code from everywhere. I'll try using session.use_trans_sid.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

You may want to do research on "Front Controller"
Post Reply