473,396 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Turning off PHPSESSID


PHP is making a right mess at the moment and insists on putting a
PHPSESSID in forms, urls and other spots on a script I am running. Is
there any way to stop it doing this? Part of the issue is it is
inserting an ampersand in the url instead of & --- ampersands are
not valid HTML Trans and I am trying to make sure my pages are valid.

Forgive me if I have asked this already today - I've been sitting here
for hours wondering if I indeed posted this question or not. Very
tired and frustrated atm.

J

Jul 17 '05 #1
3 5698
Make sure that you have 'session.use_trans_sid' turned off.

Check your php.ini file, and if it is not there, add:

session.use_trans_sid = Off

Alternativly, add this to your scripts:

ini_set('session.use_trans_sid', 0);

Best regards,

Peter
"James" <st******@gmail.com> wrote in message
news:11********************@z14g2000cwz.googlegrou ps.com...

PHP is making a right mess at the moment and insists on putting a
PHPSESSID in forms, urls and other spots on a script I am running. Is
there any way to stop it doing this? Part of the issue is it is
inserting an ampersand in the url instead of &amp; --- ampersands are
not valid HTML Trans and I am trying to make sure my pages are valid.

Forgive me if I have asked this already today - I've been sitting here
for hours wondering if I indeed posted this question or not. Very
tired and frustrated atm.

J

Jul 17 '05 #2
*** James escribió/wrote (21 Mar 2005 14:05:55 -0800):
PHP is making a right mess at the moment and insists on putting a
PHPSESSID in forms, urls and other spots on a script I am running. Is
there any way to stop it doing this?
Change this in PHP.INI:

; trans sid support is disabled by default.
; Use of trans sid may risk your users security.
; Use this option with caution.
; - User may send URL contains active session ID
; to other person via. email/irc/etc.
; - URL that contains active session ID may be stored
; in publically accessible computer.
; - User may access your site with the same session ID
; always using URL stored in browser's history or bookmarks.
session.use_trans_sid = 0

Part of the issue is it is
inserting an ampersand in the url instead of &amp; --- ampersands are
not valid HTML Trans and I am trying to make sure my pages are valid.


; The separator used in PHP generated URLs to separate arguments.
; Default is "&".
;arg_separator.output = "&amp;"
--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ No envíes tu dudas a mi correo, publícalas en el grupo
-+ Do not send me your questions, post them to the group
--
Jul 17 '05 #3
Q: When using session all the links are appended with PHPSESSID. How to
avoid that?
Q: How should I turn on or off the trans sid support?

A: when the "session.use_trans_sid" setting in php.ini is enabled, PHP
will append the session id in all relative links of the webpage. trans
sid feature helps to propagate the session id even if the browser
cookie is disabled.
To turn on or off:
1. Edit the php.ini file
2. Edit .htaccess file and set the PHP value (if you don't have
access to php.ini). This will work only in mod_php
3. Use ini_set() function <http://www.php.net/ini_set> in the script
and enable/disable this feature.

Caveats:
(3) will work only in PHP 5; previous versions don't allow to change
via ini_set(). To enable/disable this feature via script, you have to
use other hacks.
To enable:
Add the following lines in the beginning of your script:
session_start();
output_add_rewrite_var(session_name(), session_id());
To disable:
Add the following lines in the beginning of your script:
session_start();
output_reset_rewrite_vars();

or add the following lines:
ini_set('url_rewriter.tags', '');
session_start();

Refer:
http://www.php.net/ini_set
http://www.php.net/output_add_rewrite_var
http://www.php.net/output_reset_rewrite_vars

++++
@todo More info on htaccess trick. Or should find a separate question
on the ini settings.

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: JohnS | last post by:
Hi, When I initially start my browser (any of 'm) and point it to my PHP script the $PHPSESSID is always blank. On all subsequent hits or after a refresh the value for $PHPSESSID is fine... why...
4
by: Arnaud | last post by:
Hi ! I would like to propagate data between php pages, in two cases : the pages are read by : 1- Internet Explorer It's ok, data are writen in one page, and read from another. I don't use...
3
by: edward hage | last post by:
Hello , I want to pass some $_SESSION data to another page. I can pass PHPSESSID along using echo '<br /><a href="page2.php?' . SID .. '">page 2</a>'; However, I want to fill in a table...
0
by: Alex Shi | last post by:
Hi, I don't know how php process its session. I just noticed that for the first time a web site is loaded php will insert a PHPSESSID through out the page: it attach this id to links, insert...
7
by: windandwaves | last post by:
Dear Gurus Is it correct that you do not have to pass the PHPSESSID in the header in order to keep a session going. What are the advantages/disadvantages of having the PHPSESSID in the header ...
2
by: frizzle | last post by:
Hi there I have a site in which all pages ARE php-pages, but they're called/manipulated with htaccess. All files appear as a html-file to surfers. Sometimes i get the PHPSESSID declared in the...
0
by: John Smith | last post by:
Googlebot has been picking up numerous PHPSESSID name/value pairs in URIs at my website, and this causes duplicate hits and wasted bandwidth. I've since prevented PHPSESSID generation in my PHP...
29
by: CAH | last post by:
Hi Can you avoid that googlebot indexes PHPSESSID pages? Googlebot is indexing pages with PHPSESSID, which makes it think my page has a infinite number of pages. How can one avoid this? ...
1
by: Leszek | last post by:
Hi. How should I configure Apache2.2 with php5 so that PHPSESSID would be sent as a cookie ? Now I'm not getting any messages even if I set IE to ask about incoming cookies... So what is the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.