Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

php session problems when working with a windows client program

1 view
Skip to first unread message

nao921

unread,
Jul 5, 2004, 12:59:03 PM7/5/04
to
Hi everyone,

I am currently involved in a project that involves a windows client
program written in delphi and a web application written in php. I
have made several php pages for the delphi program to do requests via
the http component from INDY. the problems I am having are:

1) the first request from delphi app to php web app is the
authenication. In which user sends username + password to the php app.
If authenication is valid, a session is started and the sid is
returned to the client. All subsequent requests from delphi app to
php web app will have this sid as one of the arguments in the POST
form request (this is one of the function in the INDY component for
delphi). Even the sid is passed to the subsequent pages, the session
global array is still undefined. However if I open up a web browser
and create my own string request to the login page then the next page,
the global array would be defined (using var_dump + echo to see the
array) what is the problem?

2) does the above problem has anything to do with the http referer
field?

3) this problem that I am having has been asked before on google
group, but somehow the person who asked it didnt' put down the
solution for it. (this only involves the web only) when I login on a
page and return with a session id, then I log out.. the user is
redirected to the login page again. However if the user login again
(with a different login account), he would be presented with the same
session ID as before. a different sesson id is presented only if the
user restart the browser. why is that happening?

Chung Leong

unread,
Jul 5, 2004, 3:40:21 PM7/5/04
to
"nao921" <lawrenc...@yahoo.com> wrote in message
news:2fc83855.04070...@posting.google.com...

> Hi everyone,
>
> I am currently involved in a project that involves a windows client
> program written in delphi and a web application written in php. I
> have made several php pages for the delphi program to do requests via
> the http component from INDY. the problems I am having are:
>
> 1) the first request from delphi app to php web app is the
> authenication. In which user sends username + password to the php app.
> If authenication is valid, a session is started and the sid is
> returned to the client. All subsequent requests from delphi app to
> php web app will have this sid as one of the arguments in the POST
> form request (this is one of the function in the INDY component for
> delphi). Even the sid is passed to the subsequent pages, the session
> global array is still undefined. However if I open up a web browser
> and create my own string request to the login page then the next page,
> the global array would be defined (using var_dump + echo to see the
> array) what is the problem?

Try manually setting the session id with session_id() before calling
session_start(). I don't think PHP will automatically use the id unless it's
passed as a cookie value.


R. Rajesh Jeba Anbiah

unread,
Jul 6, 2004, 7:37:11 AM7/6/04
to
lawrenc...@yahoo.com (nao921) wrote in message news:<2fc83855.04070...@posting.google.com>...

> Hi everyone,
>
> I am currently involved in a project that involves a windows client
> program written in delphi and a web application written in php. I
> have made several php pages for the delphi program to do requests via
> the http component from INDY. the problems I am having are:
>
> 1) the first request from delphi app to php web app is the
> authenication. In which user sends username + password to the php app.
> If authenication is valid, a session is started and the sid is
> returned to the client. All subsequent requests from delphi app to
> php web app will have this sid as one of the arguments in the POST
> form request (this is one of the function in the INDY component for
> delphi). Even the sid is passed to the subsequent pages, the session
> global array is still undefined. However if I open up a web browser
> and create my own string request to the login page then the next page,
> the global array would be defined (using var_dump + echo to see the
> array) what is the problem?

Could you post a piece of your delphi script that calls PHP? I
guess, your delphi script is not handling cookies or the PHP is not
enabled with trans sid.

> 2) does the above problem has anything to do with the http referer
> field?

May or may not be. Are you sending any weird user_agent string?

> 3) this problem that I am having has been asked before on google
> group, but somehow the person who asked it didnt' put down the
> solution for it. (this only involves the web only) when I login on a
> page and return with a session id, then I log out.. the user is
> redirected to the login page again. However if the user login again
> (with a different login account), he would be presented with the same
> session ID as before. a different sesson id is presented only if the
> user restart the browser. why is that happening?

<http://groups.google.com/groups?selm=abc4d8b8.0405282351.4165ad24%40posting.google.com>
(If I'm right)

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com

nao921

unread,
Jul 6, 2004, 12:48:27 PM7/6/04
to
> Try manually setting the session id with session_id() before calling
> session_start(). I don't think PHP will automatically use the id unless it's
> passed as a cookie value.

oh! maybe I should try that. I actually called session_start() before
calling session_id()

thank you

0 new messages