Jump to content

Recommended Posts

Posted

I’m having an odd problem that I hope someone can help with.

I’m using PHP to display pages. I’m also incorporating a session using the session_start() function.

Whenever I go to the site for the first time (create a new session) all the hotlinks on the page are appended with “PHPSESSID=0fdc5fb9c9f45337309b22dc0bc846fc”. Once the page is refreshed or you load another page, it goes away and all the links are “normal”.

I’m not doing anything that I have not done before, without this problem.

 

I created a small test page to see if other code was causing this and the problem remained.

 

><script language="php">
session_start();
echo "<a href=\"index.php\">Home Page</a>";
</script>

 

the link ends up being "index.php?PHPSESSID=0fdc5fb9c9f45337309b22dc0bc846fc"

 

This leads me to believe there is some sort of server setting I need to adjust.

All the links are still functional, it is just messy and I'd like to get rid of it.

Any help is appreciated. Thanks.

Posted

Rather odd.

 

That is the unique Session key PHP creates with start_session() and the like. Usually one never sees it if transparent-ids are enabled (the default for a long time now). Is your session handling configured to set a cookie? Maybe the cookie isn't being accepted on the first visit.

Posted
Rather odd.

 

That is the unique Session key PHP creates with start_session() and the like. Usually one never sees it if transparent-ids are enabled (the default for a long time now). Is your session handling configured to set a cookie? Maybe the cookie isn't being accepted on the first visit.

 

I'm a little new to PHP, so forgive my ignorance. How would I enable/disable transparent-ids?

Posted
Rather odd.

 

That is the unique Session key PHP creates with start_session() and the like. Usually one never sees it if transparent-ids are enabled (the default for a long time now). Is your session handling configured to set a cookie? Maybe the cookie isn't being accepted on the first visit.

I'm sorry, how do I also set up the cookie. I thought a session automatically sent a cookie that expired after the browser was closed. the small code that I posted above is basically what I've got with other bells and whistles.

 

BTW this does this in IE or Firefox, so it doesn't appear to be the browser accepting the session cookie.

Posted

Read the PHP manual section on Sessions for better info. By default, PHPs session handling will use cookies to store the session info. If the cookie is not accept PHP will store the session info server side.

 

As long as your PHP version is newer than 4.1.2, transparent IDs are used by default.

 

It's almost as if the transparent ID functionality is not working on initial visit. Strange.

 

The behavior is harmless, for the most part.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...