Session ID appending to URL problem

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
rmmoore
Forum Newbie
Posts: 2
Joined: Wed Jul 31, 2002 6:09 pm

Session ID appending to URL problem

Post by rmmoore »

Hi,

I'm having a problem with session ID's being appended to every URL on a page everytime a new session is started. I can't find any php.ini variables that would cause this or any bugs in my code that will cause this. This only happens on creation of a new session. Every other page that uses the session does not do this, only the first call to the session.

Any ideas/suggestions? :?:

Thanks,
Ryan Moore
nitramoc
Forum Newbie
Posts: 3
Joined: Thu Aug 01, 2002 2:13 pm

Few answers

Post by nitramoc »

Well in your php.ini you can find the option session.use_trans_sid
if you set this to 0, PHP will not attach the SID to the URL.

The reason its only doing it for the first page is because it does not know yet if you are accepting cookies, if you are, then it will store the SID in a cookie and not use the URL. Thats why you are only seeing it attached to urls on thh first page.
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

i noticed that it would attach it to urls if i didnt write their whole address... for instance

<a href="viewnews.php">Foo</a>

would NOT validate.
but:

<a href="http://www.vexdev.com/viewnews.php">Foo</a>

WOULD validate.

hope it helped
rmmoore
Forum Newbie
Posts: 2
Joined: Wed Jul 31, 2002 6:09 pm

Oooh ok

Post by rmmoore »

Ok, good...that option is not in my php.ini config though, so I take it I need to reinstall php with some new option? Any easy way to do this?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Which version of PHP are you currently running? BTW, the install files for the latest versions are available on php.net:
http://www.php.net/downloads.php

Mac
Post Reply