Previous Thread
Next Thread
Print Thread
Rate Thread
#274752 06/09/2004 3:09 AM
Joined: Mar 2004
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2004
Posts: 118
We are running ubbt 6.4.1 and if I set session.auto_start to 0, session data is not saved as it should be.

PHP.ini
Code
<br />; Initialize session on request startup.<br />session.auto_start = 0<br />


Now, this would mean that one would have to giva a call to session_start() before any output. This looks ok since ubbt.inc.php is included by main.inc.php which is included in every php file within ubbt.

ubbt.inc.php has a session_start() approx. at 115 ln
Code
<br />// ----------------------<br />// Start the session here<br />if ($config['tracking'] == "sessions") {<br />    session_save_path($config['sessionpath']);<br />    session_start();<br />} else {<br />    $HTTP_SESSION_VARS = "";<br />} <br />


Does anyone have a clue why this is not working properly?

session.auto_start is ok for simple projects ... I would compare this with VBasic vs. VC++: with VB you can make simple applications faster and you need not to know what the code does. While with VC++ you develop more complex applications where perfomance is important AND you need to know what the code does behind.


Kind regards,
PaNTerSan
Sponsored Links
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
What version of PHP are you running?

Joined: Mar 2004
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2004
Posts: 118
Forgot php infor says 4.3.6


Kind regards,
PaNTerSan
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Can you rise your error level to 15?
There's a line in the ubbt.inc.php
like
error_reporting(7);

change it to
error_reporting(15);

Do you get any warnings then?

Joined: Mar 2004
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2004
Posts: 118
I don't get ANY warnings at all: nor at 7 nor at 15. OK - I get a lots of notice about some variables being undefined by index_whosonline but that's about it. No notices about "session already started" and no other errors. If I put autosession to 1 I get exactly the same notices.

Also I was checking what's happening with the cookie: when I log in, cookie is written as it should be. Then whatever I do (click ANY link) authenticate fails since cookie does not exist any more. global ${$config['prefix']}.w3t_mysess is empty and cookie is deleted and replaced with an almost empty one: there are variables but no values for them.


OK - I just tried this again to be sure and the cookie now remains - it just looks like the session_start() is not called BUT it is. I used PEAR var_dump to get session_Id
Code
<br />$thisSession = Session_Name().'='.Session_ID();<br />require_once('Var_Dump.php');<br />Var_Dump::display("session_start() $thisSession", '', false, VAR_DUMP_NO_CLASS_INFO);<br />

And it has the same value when I log and when I click anything else - PHPSESSID=c033bb0366c304350deb36403d8a9980.


Now I just tried to output ${$config['cookieprefix'] . "w3t_mysess"} before and after the session_start() - it's empty even when logged in hence I tried the same with autosession = 1 and it works. When I click something else I get a value for ${$config['cookieprefix'] . "w3t_mysess"}.


Looks like get_input is not working if the session_start() call is not made before... let me try.

Yap I just moved the if block with session_start() above get_input if block - even upper before find_environmental call since this one is also using global server var (e.g. $_SERVER).

Here is the
Code
<br />if (isset($config['one_community']) && ($config['one_community'])) {<br />    define('ONE_COMMUNITY', "1");<br />    include("$thispath/oc.inc.php");<br />} <br /><br />// ----------------------<br />// Start the session here - BEFORE any references to server global vars (by PaTNerSan)<br />if ($config['tracking'] == "sessions") {<br />    session_save_path($config['sessionpath']);<br />    session_start();<br />} else {<br />    $HTTP_SESSION_VARS = "";<br />} <br />

Sweeet


Kind regards,
PaNTerSan
Sponsored Links
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Glad you solved it!
I think this is a bug, which should be reported over at infopop so that Rick can fix it for the next release.

Joined: Mar 2004
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2004
Posts: 118
Our License expired two months ago and now we are waiting for 6.5 to renew the license. Just do it


Kind regards,
PaNTerSan

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)