php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17144 No Session ID and losing Session Var's between pages
Submitted: 2002-05-10 14:57 UTC Modified: 2002-07-02 13:23 UTC
Votes:4
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: eric dot jones at hua dot army dot mil Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.2.0 OS: FreeBSD 4.5
Private report: No CVE-ID: None
 [2002-05-10 14:57 UTC] eric dot jones at hua dot army dot mil
Config line:
./configure '--prefix=/usr/opt/php' '--with-apxs=/usr/opt/apache/sbin/apxs' '--with-mysql=/usr/opt/mysql' '--with-pgsql=/usr/opt/pgsql' '--with-mm' '--with-ldap' '--enable-trans-sid' '--enable-magic-quotes' '--enable-shared' '--enable-mhash' '--enable-ftp' '--with-gettext' '--enable-mailparse' '--enable-libgcc' '--enable-calendar' '--with-openssl'

Other details:
Register Globals = OFF
Enable Trans SID = ON
Set Session Cookies = 1
Session Auto Start = 1

I have a login form that asks for a used name and password. Once the user has been authenticated they are assigned a set of $_SESSION Variables:

----code----
$_SESSION['login'] = $_POST['login'];
$_SESSION['password'] = $_POST['password'];
$_SESSION['logged'] = $_POST['logged'];
$_SESSION['action'] = $action;
$_SESSION['rank_id'] = $rank_id;
----end code ----

When the users click on a link in the menu system all these variables are lost (ie echos come up blank).

If i add the session_start(); at the top of the page then the variables are passed without a problem.

If at any time i try to echo out the Session ID (which for me is SFDICsession) i get a blank value using the following code:

----code----
<?=$_REQUEST['SFIDCsession']?>
----end code -----

thoughts?

Thanks in advance!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-13 19:07 UTC] eric dot jones at hua dot army dot mil
also trying to echo session_id(); with no success. 

Still not working in 4.2.1 released May 13th

Also i can't Edit my submission
 [2002-06-27 22:45 UTC] sniper@php.net
session_start() is _required_ even with the new $_SESSION variable..was this the problem?

 [2002-06-28 22:14 UTC] eric dot jones at hua dot army dot mil
It was my understanding from the online docs that if i have session auto start set to on (ie 1) that i would not need the session_start() function.  but if this is not the case then i guess i do not have a bug :)
 [2002-06-28 22:16 UTC] sniper@php.net
Question is, does it work when you have session_start() or not? 
 [2002-06-28 22:18 UTC] eric dot jones at hua dot army dot mil
yes. when i have session_start(); it works fine. but without session_start() i lose all variables when i transition pages.
 [2002-06-28 22:19 UTC] sniper@php.net
So it's session.auto_start which doesn't work. 
I'll test it myself soon.


 [2002-06-29 11:09 UTC] sniper@php.net
I tested this and it works for me. At least this simple
script:

<?php
echo $_SESSION['test']++;
?>

(gotta reload the page twice to get output, of course :)

This worked with the latest CVS checkout.
In phpinfo() output, is the session.auto_start On ?
(in both fields)

If not, then you might be changing the setting in wrong
php.ini which is not even used..check this first.

If that wasn't the problem, then try with this snapshot:

http://snaps.php.net/php4-latest.tar.gz
 [2002-07-02 12:19 UTC] eric dot jones at hua dot army dot mil
Ok i blew away my php.ini and tried it again. it still didn't work. Then i checked around with some people and it turns out that i was working on the wrong php.ini.

php was looking for it in /usr/opt/php/lib/ and i had it in /usr/local/lib/ 

so once i moved it to the /php/lib/ folder all seems to work now.

sorry to have wasted you time....
 [2002-07-02 13:23 UTC] sniper@php.net
User error, bogus.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 02 03:01:30 2024 UTC