Jump to content


Getting rid of &PHPSESSID


16 replies to this topic

#1 Programmerguy150

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Interests:Eating your soul<br />P2L<br />PHP<br />Tutorials<br />Eating your soul..

Posted 26 November 2005 - 03:47 AM

I am working on getting my forum compliant, before I go on a coding spree and kill all in my path;).

http://validator.w3.org/check?uri=http%3A%...&doctype=Inline

Results. I dont want sid in the url, and I did add
session.use_trans_sid = 0

to php.ini but it wont work:(

#2 HaloprO

    Requires Armed Escort

  • Members
  • PipPip
  • 310 posts
  • Gender:Male
  • Location:California, USA

Posted 26 November 2005 - 12:23 PM

Well you can use a work around like this
<?php
if (!isset($_SESSION['variable'])) {
	session_start();
	header('Location: index.php');
} else {
	session_start();
}
?>
When the user first visits the page it will redirect back to the same page, and then it won't show PHPSESSID in links.

#3 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 26 November 2005 - 12:52 PM

Halopr0, i don't think that was his question. He wants it to validate (or at least that's the way it appears).

http://php.net/manua...ession-name.php
http://php.net/manual/en/ini.core.php#ini....eparator.output
These links should provide the info you're looking for, if what i think you're asking is correct.

#4 HaloprO

    Requires Armed Escort

  • Members
  • PipPip
  • 310 posts
  • Gender:Male
  • Location:California, USA

Posted 26 November 2005 - 01:24 PM

Read his topic title rc :)

#5 Programmerguy150

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Interests:Eating your soul<br />P2L<br />PHP<br />Tutorials<br />Eating your soul..

Posted 26 November 2005 - 03:13 PM

I just want it to validate;). Dont care how it is done, just want it to;).

just to let everyone know, I am on shared hosting.

Edited by Programmerguy150, 26 November 2005 - 03:16 PM.


#6 Blitz

    Jedi In Training

  • Twodded Staff
  • PipPip
  • 307 posts
  • Location:California
  • Interests:Php, html, css, etc, band, trumpet, anime, my dog, TV, computers, video games, sleeping, marching band, sleeping, jazz, sleeping, metal, sleeping, classic rock, sleeping, music, jazz band, did I mention sleeping?, kicking the hell out of kids that won't take the time to spell or use proper grammar, my website, etc.

Posted 26 November 2005 - 05:44 PM

In the link, instead of putting <a href="something.php?&PHPSESSID=, put <a href="something.php?&amp;PHPSESSID=. That's the problem. If you have an ampersand (&) before anything, the validator will look for a corresponding entity, like &lt; or &gt;. So to solve that, use the entity for the ampersand, which is &amp;. Use that for every & in links and it'll solve those problems.

#7 Programmerguy150

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Interests:Eating your soul<br />P2L<br />PHP<br />Tutorials<br />Eating your soul..

Posted 26 November 2005 - 05:48 PM

The issue is.. I didnt put that in the links. Only the stupid validator gets that. Its nowhere in the source.

#8 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 26 November 2005 - 06:25 PM

View PostHaloprO, on Nov 26 2005, 11:24 AM, said:

Read his topic title rc ;)

View PostProgrammerguy150, on Nov 26 2005, 01:13 PM, said:

I just want it to validate;)...
:P

View PostProgrammerguy150, on Nov 26 2005, 03:48 PM, said:

The issue is.. I didnt put that in the links. Only the stupid validator gets that. Its nowhere in the source.
Line 222:
<td class="tdforumbottommiddle1">

<!-- Show the name of the forum -->
<a href =" forum.php?id=1&PHPSESSID=9d07961ed25e37aa06240b91445f15f2">General Talk</a>

</td>
Correction, it is in the srouce. My last post will help a bit, but the following should help a little more.http://www.php.net/manual/en/ref.session.p...l-rewriter.tags

Edited by rc69, 26 November 2005 - 06:26 PM.


#9 Programmerguy150

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Interests:Eating your soul<br />P2L<br />PHP<br />Tutorials<br />Eating your soul..

Posted 26 November 2005 - 06:51 PM

Yah, but FF source... and IE source dont show it. That article didnt really help. I have tried everything, but it still goes on:S.

My php.ini:

magic_quotes_gpc = no 

register_globals = off

session.use_trans_sid = 0

arg_separator.output = "&amp;"

arg_separator.input = "&amp;"


#10 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 26 November 2005 - 07:50 PM

I copied that source directly from FF, so yes, it does show it.

#11 Programmerguy150

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Interests:Eating your soul<br />P2L<br />PHP<br />Tutorials<br />Eating your soul..

Posted 26 November 2005 - 08:15 PM

<td class="tdforumbottommiddle1">

<!-- Show the name of the forum -->
<a href =" forum.php?id=1">General Talk</a>

Firefox 1.07

#12 austen

    P2L Jedi

  • Members
  • PipPipPip
  • 910 posts
  • Location:Montana, US
  • Interests:Web design, snowboarding (lots of it), Computer science related.

Posted 26 November 2005 - 08:29 PM

I THINK that you'll notice if you refresh the page that the PHP session id is on, the big ugly sessid string will be gone... try to validate it then maybe?

Austen :P

#13 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 26 November 2005 - 08:30 PM

Well, i don't know what's wrong with your browser, but it's in every link on my computer.
Do you have any cookies/admin features wrote in that affect sessions?

As it stands right now, you're beyond my help, i've given you everything i know of that deals with PHPSESSID.

Edit, just tested austens thingy, after refresh, the PHPSESSID is gone... This doesn't change my previous statement.

Edited by rc69, 26 November 2005 - 08:32 PM.


#14 Programmerguy150

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Interests:Eating your soul<br />P2L<br />PHP<br />Tutorials<br />Eating your soul..

Posted 26 November 2005 - 08:42 PM

I understand. Everything that you have said though is what I have tried. That is the reason I am stumped:). Thanks for trying htough, I hope I can figure this out!

#15 HaloprO

    Requires Armed Escort

  • Members
  • PipPip
  • 310 posts
  • Gender:Male
  • Location:California, USA

Posted 27 November 2005 - 12:21 AM

&PHPSESSID occures the first time a page is visited and when the session is started, so if you completely close out your browser and go back to your page, you will see it again, Validator will always find it because it doesn't store the session information.

#16 kazaru-kun

    Young Padawan

  • Members
  • Pip
  • 83 posts

Posted 27 November 2005 - 09:22 PM

so is there is no way to fix this? by the way for some reason when you use the validate function opera it doesn't show the session id and validates fine

Edited by kazaru-kun, 27 November 2005 - 10:01 PM.


#17 HaloprO

    Requires Armed Escort

  • Members
  • PipPip
  • 310 posts
  • Gender:Male
  • Location:California, USA

Posted 27 November 2005 - 10:27 PM

Because opera is for fat people ;), I mean, what I posted earlier will work :D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users