Connecting Tech Pros Worldwide Help | Site Map

PHP Session Problem

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 09:58 AM
Fred
Guest
 
Posts: n/a
Default PHP Session Problem

Hello,

When I use Session in my php code, the first time a session is
establish, every link on that page (where the session starts)
contains the PHPSESSID in the query.

For example:
session.php?PHPSESSID=d3994a591c42b9d3bba48ae65434 1482

If we follow the link, the PHPSESSID disapears, which makes sence to me
because the ID was added as a "cookie" to the browser and there is no
need to continue to be in the URL.

My question is, can I avoid this? (because of search engines)

I have tried in 3 different hosts and it happens in all of them. Except
in my localhost machine, don't know the reason why.

Can someone help me?

Here is the code. Just paste it in a file named session.php

<?php
session_start();
print "<html><a href=\"session.php\">Test the problem</a></html>";
?>

Thanks,
Fred


  #2  
Old July 17th, 2005, 09:58 AM
Pedro Graca
Guest
 
Posts: n/a
Default Re: PHP Session Problem

Fred wrote [edited]:[color=blue]
> My question is, can I avoid [session ids in URLs]?[/color]

<snip>
[color=blue]
> Here is the code. Just paste it in a file named session.php
>
> <?php[/color]

Try one or both of these:

ini_set('session.use_trans_sid', '0');
ini_set('session.use_only_cookies', '1');
[color=blue]
> session_start();
> print "<html><a href=\"session.php\">Test the problem</a></html>";
> ?>[/color]

--
Mail to my "From:" address is readable by all at http://www.dodgeit.com/
== ** ## !! ------------------------------------------------ !! ## ** ==
TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>)
may bypass my spam filter. If it does, I may reply from another address!
  #3  
Old July 17th, 2005, 09:59 AM
Fred
Guest
 
Posts: n/a
Default Re: PHP Session Problem

Dear Pedro,

I have tried your sugestion.

It works on PHP Version 4.2.3 but NOT on the recent Version 4.3.9.
Bad luck for me, because what I want is in Version 4.3.9
Any other ideas? :(

Thank you,
Fred

  #4  
Old July 17th, 2005, 09:59 AM
Fred
Guest
 
Posts: n/a
Default Re: PHP Session Problem

Hello,

So, I tried with ini_set("url_rewriter.tags",""); and it worked.

http://martin.f2o.org/php/session, this page has it all.

Thanks for the help anyway. Could not have done it without you.
Regards,
Fred

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.