Goddam cookies - cannot predict id before its too late
Posted: Sat May 24, 2003 1:56 pm
Ok - i have read the manual (allthough its not the most clear way).
1) i have a a form and a script for login (ID , passw)
2) i have a menu form and a script which is only allowed after the login form.
note: the login script could as well put out the menu form, so 1) and 2) would be the same.
In 2) the menu, i want to know/use the ID of the guy who logged in.
A cookie would be obvious (or a session).
The problem is the headers - after the login form its too late to set a cookie with the ID for the next form menu, because i have output HTML allready.
And no - i could put it in a GET request like: ?name=donald?id=duck - but then its visible in the adress bar.
how the heck is is possible to use a cookie for that ?? eg. setting a cookie with ID-data after some html jimbo.
it seems that the cookie thing is not well suited for such a login->menu->submenu->etc..
note:
A question might be: how often and when are the header sent. yes - i know at the first
instance of output. but wat if u jump to another html or php with the header(location....) ?
btw: pls don't send suggestions that ure not absolutely sure works.
1) i have a a form and a script for login (ID , passw)
2) i have a menu form and a script which is only allowed after the login form.
note: the login script could as well put out the menu form, so 1) and 2) would be the same.
In 2) the menu, i want to know/use the ID of the guy who logged in.
A cookie would be obvious (or a session).
The problem is the headers - after the login form its too late to set a cookie with the ID for the next form menu, because i have output HTML allready.
And no - i could put it in a GET request like: ?name=donald?id=duck - but then its visible in the adress bar.
how the heck is is possible to use a cookie for that ?? eg. setting a cookie with ID-data after some html jimbo.
it seems that the cookie thing is not well suited for such a login->menu->submenu->etc..
note:
A question might be: how often and when are the header sent. yes - i know at the first
instance of output. but wat if u jump to another html or php with the header(location....) ?
btw: pls don't send suggestions that ure not absolutely sure works.