Nov 21, 2009

Need Help - How To Remove Session ID From URL

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Programming > Scripting > PHP

Need Help - How To Remove Session ID From URL

sid.calcutta
Oflate I was going through Google information for webmasters and I noticed the following technical guideline for the webmasters:
QUOTE
Allow search bots to crawl your sites without session IDs or arguments that track their path through the site. These techniques are useful for tracking individual user behavior, but the access pattern of bots is entirely different. Using these techniques may result in incomplete indexing of your site, as bots may not be able to eliminate URLs that look different but actually point to the same page.

It clearly shows that undesired session IDs may have adverse effect at least for two reasons :
1)Duplicating content!
and 2) crawlers may enter into an infinte loop and access the same page repeatedly as it may not be able to eliminate URLs that look different but actually point to the same page.
However, I could not find any suitable method either for allowing the bots to crawl my site without session IDs or to remove the undesired session IDs from the url.
I searched for a solution and got this one:
CODE

         ini_set( 'session.use_cookies', ( int )1 );
         ini_set( 'session.use_trans_sid', ( int )1 );
         session_start();
        


But it did not work for me.
Now is there any other way to remove undesired session IDs from the URL? or am I making some mistake in handling sessions.
Thanks in anticipation of some good advice.
Regards,
Sid

 

 

 


Comment/Reply (w/o sign-up)

Hercco
You can turn the session ID transmission from URI off using a .htaccess file and php flags. I've done this as I feel it's lot handier than adding the lines to every page header.

Just in .htaccess file put the following lines:


CODE

php_flag session.use_trans_sid off
php_flag register_globals off



Although the code you specified should in my opinion work. Well, try the htaccess method and if it doesn't work let's figure out something else.

Comment/Reply (w/o sign-up)

Quatrux
Just make your scripts that they would not do that, I never had problems with this kind of things, but I don't know what url's you're using, I always use GET or PATH_INFO or QUERY_STRING and use sessions. Those PHPSESSID is annoying for me, I usually change the name for the session and work with that cookie. wink.gif

Comment/Reply (w/o sign-up)

sid.calcutta
QUOTE(Quatrux @ Apr 3 2006, 03:26 AM) *

....I always use GET or PATH_INFO or QUERY_STRING and use sessions....)

Thanks Quatrux, your suggestions helped me a lot. Now that PHPSESSID is no more there.
Also I think, putting "php_flag register_globals off" in .htacces file, would turn the global variables off. As I have used global variables, so it was just not ideal for me to do like that. Still thanks to you Hercco for your suggestion.
Regards,
Sid

Comment/Reply (w/o sign-up)

wojta
QUOTE(sid.calcutta @ Apr 1 2006, 10:15 PM) *

Oflate I was going through Google information for webmasters and I noticed the following technical guideline for the webmasters:

It clearly shows that undesired session IDs may have adverse effect at least for two reasons :
1)Duplicating content!
and 2) crawlers may enter into an infinte loop and access the same page repeatedly as it may not be able to eliminate URLs that look different but actually point to the same page.
However, I could not find any suitable method either for allowing the bots to crawl my site without session IDs or to remove the undesired session IDs from the url.
I searched for a solution and got this one:
CODE

         ini_set( 'session.use_cookies', ( int )1 );
         ini_set( 'session.use_trans_sid', ( int )1 );
         session_start();
        


But it did not work for me.
Now is there any other way to remove undesired session IDs from the URL? or am I making some mistake in handling sessions.
Thanks in anticipation of some good advice.
Regards,
Sid


Perhaps session.use_trans_sid is the ticket you're looking for...

Wojta

 

 

 


Comment/Reply (w/o sign-up)

vhortex
QUOTE(sid.calcutta @ Apr 26 2006, 03:07 AM) *

Thanks Quatrux, your suggestions helped me a lot. Now that PHPSESSID is no more there.
Also I think, putting "php_flag register_globals off" in .htacces file, would turn the global variables off. As I have used global variables, so it was just not ideal for me to do like that. Still thanks to you Hercco for your suggestion.
Regards,
Sid


well, on my opinion only.. it is best to turn off register globals to your site..
but you need to convert all those variable callin to his types

$_POST
$_GET
$_SESSION

on my own experience, register globals on can provide lots of problems
which is to many to mention all here..

Comment/Reply (w/o sign-up)

iGuest-Lindsay
Are there platforms in which removing session ID\\
Need Help - How To Remove Session ID From URL

I have been trying to find a way to mask session ID's from our site (http://www.Hrdirect.Com) because they are killing our SEO. I'm being told that doing so is "Not possible in our platform" Is this possible?

-reply by Lindsay

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : , remove, session, id, url

  1. Run A Script When Expires A Session
    (6)
  2. Php Session Problem
    (7)
    i have downloaded easyphp on my PC and i am a bit noob with php mysql commands. i have a problem
    making session work the problem that the session file in my server get deleted after leaving the
    page where the session was start for the first time. the problem that the session can only be used
    within the creation page unless you leave it. why?? i have no idea ... i have been looking around
    for three days now .. thank in advance for any help. if you need more details let me know
    /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />. Joe.k....
  3. Already Sent Session Cookies?
    (2)
    Er, this is the second topic I've posted about session problems. Here's the html file that
    keeps showing up: CODE Warning: session_start() : Cannot send session cookie - headers already
    sent by (output started at C:\Program Files\xampp\htdocs\index2\loggingin.php:2) in C:\Program
    Files\xampp\htdocs\index2\loggingin.php on line 39 Warning: session_start() : Cannot send session
    cache limiter - headers already sent (output started at C:\Program
    Files\xampp\htdocs\index2\loggingin.php:2) in C:\Program Files\xampp\htdocs\index2\loggingin.php on
    line 39 Fatal ....
  4. Help: Removing A Specific Header With cURL
    (0)
    Hi all, I' ve problem sending HTTP POST(multipart/form-data) request using CURL. The server
    always reply with HTTP/1.1 417 Expectation Failed . Then I review my code and the tcp packet using
    wireshark for long long time /sad.gif" style="vertical-align:middle" emoid=":(" border="0"
    alt="sad.gif" /> just to figure out where is the error!. This problem only for one site and for the
    others site my script works perfectly!. here is my packet that sent to the server CODE POST
    xxxxxxxx HTTP/1.1 Cookie: PHPSESSID=447c6f5c9e73c22a1bf50dd46940306e Host: www.xxxxxxxxxx....
  5. How To Delete Files When Session Ends
    (4)
    Dear Friends I need solution to a problem. The problem is as under: I am creating certain files
    (playlist) in server disk when user selects some songs. The files are created in ram format. What I
    want to do is to delete these files created during a particular session. Is it possible to do so?
    Now I am deleting these files using on Unload event fired by JavaScript. I am using PHP. ....
  6. User Authentication Session Handling Problems
    Authorization server variables not staying across pages (14)
    This is quite a bit of problem I am facing, and I cannot point exactly where I am going wrong. I
    have been lurking around here at the Asta Host forums with regard to login and user authentication
    scripts and I have got as far as this: - Starting a session - Registering a session variable -
    Using the variable to check if the user is authenticated or not. - Authenticating the user through
    MySQL database - Logging of the user, by setting the session variable to un-authenticated I have
    been able to achive the following things too that I think is not related to this proble....
  7. Session And Security
    (0)
    Hi everyone, I'd like to explain my idea for basic session handling to you guys. I've
    thought about it, and I can't see any problem with it, but I'd like other's opinions as
    well, please. Ok, here goes. So basically, there's two base cases that can happen. User
    visits any page, session class is initialized, etc. Case 1 - User not logged in; no cookie or
    session info in DB If the user is not logged in, has no cookie, and/or there is no session info in
    the DB for this user, any specified activities, protected like so: php: if ( $session....
  8. How To Remove A Cookie Using PHP
    (1)
    Hi :-) How can i remove a cookie from $_COOKIES array ? P.S.: sorry it there is any mistakes in
    my english :-) Topic title edited to suit the nature of content better. In future try to make
    your topic title more descriptive. ....
  9. Php And Session
    Talk about Session Handling in PHP (4)
    I have a problem in handling Session. When I log on to my site using the passwords and username that
    i have maintained in my database... After authentication, I start a session... but still when i
    again visit the admin page it asks me the username and password... I have added all the
    authentication and checking.......
  10. Php, Sql Lite: Storing Session's Data?
    how so store session in SQLITE? (1)
    normally, in windows, session data is saved in the location as directed by the "session.save_path"
    directives. they only show how to store session data in file. is it possible to store it inside the
    SQLite? anyone?....

    1. Looking for , remove, session, id, url

See Also,

*SIMILAR VIDEOS*
Searching Video's for , remove, session, id, url
advertisement



Need Help - How To Remove Session ID From URL

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com