ibjdt
Programmer
- Nov 25, 2002
- 63
can a script print cookies to the header and redirect?
i have an shtml page calling a perl cgi script through ssi.
the script checks for a sessionID cookie. if not found it displays a login form. the login form points to another cgi script that handles the login, creates a cookie and redirects back to the shtml page.
my intent was that when redirected back, the ssi would find the new cookie and not post the login form. however, although the login script works (it adds my login to the login database), the cookie doesn't print to the header so it isn't found.
normally i create the cookie with
but if i do that before the redirect, the resulting page literally shows the redirect path on screen:
"Location:
any suggestions??
thanks.
i have an shtml page calling a perl cgi script through ssi.
the script checks for a sessionID cookie. if not found it displays a login form. the login form points to another cgi script that handles the login, creates a cookie and redirects back to the shtml page.
my intent was that when redirected back, the ssi would find the new cookie and not post the login form. however, although the login script works (it adds my login to the login database), the cookie doesn't print to the header so it isn't found.
normally i create the cookie with
Code:
print $cgi->header(-cookie=>[@cookies]);
but if i do that before the redirect, the resulting page literally shows the redirect path on screen:
"Location:
any suggestions??
thanks.