Php sessions

cca

Perch
Hi, hoping someone could shed some light.
Have a customer who installed classifieds php script on win2 & can't logon to do more configuration cause sessions are not sticking. here is the sessions script:

session.php
<?
session_start();
session_register("softbiz_b2b_adminid");
session_register("softbiz_b2b_adminname");
//session_register("ID");
//session_register("ID");
?>

& logincheck.php

<?php
include "session.php";
if (!isset($_SESSION["softbiz_b2b_adminid"]) && !isset($_REQUEST["tmp"]) )
{
header("Location: ". "index.php?msg=" .urlencode("You must be logged to access this page!") );
die();
}

?>


If i remove

if (!isset($_SESSION["softbiz_b2b_adminid"]) && !isset($_REQUEST["tmp"]) )
{
header("Location: ". "index.php?msg=" .urlencode("You must be logged to access this page!") );
die();
}

from logincheck.php than i can access admin area, which tells me its the session not being handled/stored correctly by server.

I have played with a custom php.ini with no luck(I'm new with php)

Anyone had similar issue or could provide help appreciated.
 
You were on the right track with the custom php.ini, now in the session path there, make sure you have the full path like d:\hshome\username\domain.com\sessions or d:\hshome\username\sessions
 
you might also make sure the session is being written with session_write_close(). Where are the sessions saved? If they are anywhere other than the folder from where you are running the file than you must set a session_start("path/to/session/being/called/").
 
Thanx guys, i'll try what you suggest.

BTW, I'm a bit miffed that i need a custom php.ini at all, why are sessions not handled correctly with the default windows php.ini,

i have submitted a ticket BKL-16256-685 about this, & i am no php coder so what is the problem with jodo just fixing this up for me like i asked instead of me floundering around for days & trying to keep my customer tamed.

This is an out of the box application that should run on windows without me trying to customise php to suit & i find myself doing work jodohost should really be doing to fix this issue!
 
cca, it is a more secure way in having your own sessions, instead of shared among all the server.
 
Thats fine, i'm sure my customer is happy to have a php.ini file so long as sessions work...unfortunately i have expressed to jodo that i am not experienced enough to make the necessary changes to php.ini to get the sessions to work for this scripts concerned.

Is there an error in the customers script? no i don't think so...
Is the problem the version of php on the win2 server doesnot handle session? must be cause i'm being told to change php.ini

So again....why can't jodohost fix the php.ini i have place in the root folder to make the sessions work for this script. As i have stated I am not qualified enough....

The ticket i mentioned was placed 3 days ago with the jodo replies usually only after i jumped on live help to get it updated....

Am i being unreasonable, i donot wish to be, only trying to help my customer get his script working thru no fault of his own.

Would sessions problem persist if the customers script was moved to unix?

BTW: this guy paid about $200 for his script & still hasn't been able to configure it cause he can't login.....
 
Ok well i downloaded the scripts to my iis on my machine at home which is running PHP Version 5.0.3 & the script runs flawlessly & am able to logon to admin panel(sessions worked)

I duplicated some of the vaues from my php.ini on my hard drive into the root & could not get it to fail from my iis but the custom php.ini did not resolve the sessions problem on jodo's servers.

phpinfo shows php version 4.3.11 on my win, I thought we recently were upgraded tp php 4.4.0?

This is driving me nuts, I have spent the last 3 days playing with this & I can't leave it alone.

Any help ? Stephen?? someone???
 
Back
Top