Re: [phplib] session problems From: fabrizio.ermini <email protected>
Date: 04/18/01

On 18 Apr 2001, at 7:26, Faine, Mark wrote:

> If you click to request a document a php script request.php is called it
> is sort of like a cart script, and uses phplib sessions and db_oci8. The
> strange problem I am having is this:
>
> If it is the first time you have reqeusted this script since last
> opening your browser, you will get a 404, if you hit back/forward or
> refresh the
> script works fine as if nothing ever happened. You will not get this error
> again as long as you do not close and reopen your browser.
>
> Any ideas?
>
Are you passing some POST variables to the php page?
The first time you call a page that is part of a "session" (i.e. the
first time you execute page_open) the code does a redirection to
the page to test browser cookie capability. This way, when the
page is called, it does not receive any POST variable that was
passed originally. This is known behaviour, it's not a bug.
The "correct" way to resolve this issue is opening the session
BEFORE start posting variables around. To answer your second
question, page_open should be at the very start of every page (non
counting the included ones, of course). If you are using cookies,
nothing bad happens if some page is missing it (except for the fact
that you won't have access to $sess object on that page, of
course), but you'll break compatibility with get mode in this way.
Another workaround is passing the vars as get, that IIRC are
preserved as part of the URL when the redirection is made, or with
some other way - storing them in a DB table, or similar.

HTH, bye

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Fabrizio Ermini Alternate E-mail:
C.so Umberto, 7 faermini <email protected>
loc. Meleto Valdarno Mail on GSM: (keep it short!)
52020 Cavriglia (AR) faermini <email protected>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>