getting rid of PHPSESSID in the url

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • superfly
    Member
    • Mar 2004
    • 80

    #1

    getting rid of PHPSESSID in the url

    ini_set("session.use_trans_sid", 0);

    I usually put this before session_start(); and it works... but suddenly it has no effect and that ugly PHPSESSID=df98xfujow is in my url and ruining all my SEO efforts. Any idea why it would stop working?
  • Buddha
    Senior Member
    • Mar 2004
    • 825

    #2
    session.use_only_cookies
    session.use_cookies

    Have you tried setting those too?
    "Whatcha mean I shouldn't be rude to my clients?! If you want polite then there will be a substantial fee increase." - Buddha

    Comment

    • superfly
      Member
      • Mar 2004
      • 80

      #3
      no, becasue I dont use cookies, only sessions @ the moment. All I want to do is to get rid of that nasty PHPSESSID in the url..

      Comment

      • Tycho
        Junior Member
        • Mar 2004
        • 14

        #4
        i just did this on one of my sites today.

        I added a php.ini in the www root with the following lines
        Code:
        session.use_trans_sid = off 
        session.use_cookies = off 
        session.use_only_cookies = on
        Seems to work for me.

        Comment

        • Buddha
          Senior Member
          • Mar 2004
          • 825

          #5
          Originally posted by superfly
          no, becasue I dont use cookies, only sessions @ the moment. All I want to do is to get rid of that nasty PHPSESSID in the url..


          PHP session come in two flavors cookie and URL. If you don't want the PHPSESSID in the URL then your stuck with cookies. If you want to pass session ids via hidden form fields through POST then you'll need to write it yourself or find a script that does that (Can't think of one off the top of my head).
          "Whatcha mean I shouldn't be rude to my clients?! If you want polite then there will be a substantial fee increase." - Buddha

          Comment

          • superfly
            Member
            • Mar 2004
            • 80

            #6
            So I create a new php.ini file and put those 3 lines of code in it and put in public_html?

            Comment

            • Buddha
              Senior Member
              • Mar 2004
              • 825

              #7
              Originally posted by superfly
              So I create a new php.ini file and put those 3 lines of code in it and put in public_html?
              I think you could just add them like you have the other one.

              Code:
              ini_set("session.use_trans_sid", 0);
              ini_set("session.use_cookies", 0);
              ini_set("session.use_only_cookies", 1);
              If you do it with php.ini file, I think you would have to do it for every directory. Which could be a lot of work for something big like a CMS.
              "Whatcha mean I shouldn't be rude to my clients?! If you want polite then there will be a substantial fee increase." - Buddha

              Comment

              Working...