473,830 Members | 2,182 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5719
Make sure that you have 'session.use_tr ans_sid' turned off.

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

session.use_tra ns_sid = Off

Alternativly, add this to your scripts:

ini_set('sessio n.use_trans_sid ', 0);

Best regards,

Peter
"James" <st******@gmail .com> wrote in message
news:11******** ************@z1 4g2000cwz.googl egroups.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_tra ns_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_tr ans_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_rewr ite_var(session _name(), session_id());
To disable:
Add the following lines in the beginning of your script:
session_start() ;
output_reset_re write_vars();

or add the following lines:
ini_set('url_re writer.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
6902
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 do I have to complete a php file before the $PHPSESSID is set? I tried to do session_start() before anything still blank, what did I miss? (Aix 4.3.3, php 4.2.1,Apache 1.13.26)
4
8268
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 PHPSESSID 2- from a mobile browser ( mobile i-Mode phone Nec22) After several tests, I understod it's impossible, because the session system tries to write a cookie on the browser...
3
7330
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 with values and include PHPSESSID with it. This does not work. I tried somethink like this: <INPUT TYPE="Hidden" NAME="PHPSESSID" VALUE="<?=SID ?>">
0
1713
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 hidden field into form, and even attach the id onto form button if the button is an image. Here are samples what it did: <a href="http://link?PHPSESSID=e2b49283217665659a856cd939f10881>
7
7031
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 e..g. http://www.myurl.com/index.php?PHPSESSID=...... Thank you
2
7760
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 url. I want to avoid this from caching in the browsers history. is there a way to detect if PHPSESSID is set, and if
0
1764
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 script if Googlebot makes the request; like so: if(preg_match("/googlebot/i", $_SERVER) != 1) //session code here ....but this doesn't stop the PHPSESSID requests from Googlebot because they're already stored in its database, and it continues...
29
4879
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? Here is an exsample of url that google register, that might make is more clear what is happening www.winches.dk/winches.php?artnr=500735&PHPSESSID=d22126f0d46334659ff...
1
2587
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 default way of sending PHPSESSID if not as a cookie? What is the best way to send PHPSESSID? thanks,
0
9781
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10769
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10477
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10522
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10197
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7740
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6944
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5615
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4408
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.