Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #6202

Overriding PHP INI Setting session.use_trans_sid=0

From Robert Rosenberg <hal9001@panix.com>
Newsgroups comp.lang.php
Subject Overriding PHP INI Setting session.use_trans_sid=0
Date 2012-05-26 17:59 -0400
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <CBE6CA9C.27064%hal9001@panix.com> (permalink)

Show all headers | View raw


My Hosting Service has the following PHP settings [per phpinfo():]

session.use_cookies      On   On
session.use_only_cookies Off  Off
session.use_trans_sid     0    0

This means that while my Session ID is stored in a cookie it will not be
automatically appended to my "a href" URLs when clicked. I am dealing with
some paranoid users who may have turned off cookie support or who monitor
cookie usage and reject some cookies or domains (I will not even get into
those who have "protected themselves" by turned off JavaScript <g>).

Thus I need to be able to compensate for their refusal to accept the
automatic cookie used by Sessions Support to pass the Session Id back to the
scripts when they start by having PHP append a "?PHPSESSID = ..." to my
URLs.

This requires that session.use_trans_sid=1 (which I am attempting to do via
these commands at the top of my pages):

<?php
ini_set('session.use_only_cookies',0);
ini_set('session.use_trans_sid',1);
session_start();
?>

The ?PHPSESSID = is not showing up when I use a x.php link on my pages. The
location bar when I click the link is just x.php. While I can force the
needed parm by hard coding the ?PHPSESSID = in my links, I would rather go
the automatic route.

I need sessions so that I can have restricted pages/areas which are only
viewable by those who have logged and and have the requite viewing
authority. All others when attempting to view the pages will get a "Please
Login to view this page/area" notification (and a link to the Login Page) if
not logged in or a "You Are Not Authorized to view this Page/Area"
notification if logged in but not authorized.

I can post my testing code (for forcing the URL) if that will help diagnose
my problem.

Thank You.

Back to comp.lang.php | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Overriding PHP INI Setting session.use_trans_sid=0 Robert Rosenberg <hal9001@panix.com> - 2012-05-26 17:59 -0400
  Re: Overriding PHP INI Setting session.use_trans_sid=0 Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-05-27 01:00 +0200
  Re: Overriding PHP INI Setting session.use_trans_sid=0 Jerry Stuckle <jstucklex@attglobal.net> - 2012-05-26 19:05 -0400

csiph-web