Hello Everybody,
I have setup a simpe site that verifies a user and redirects them where they need to go. For the last page I want to setup a session or cookie variable to make sure they have been verified. The session part worked fine on a local server I have. I then uploaded it to my hosting company and it fails. If I try to echo the session variable it blanks the whole page.
I then decided to try cookies. Apparently I do not know how to do this. I used the following to set the cookie: setcookie("grpchk", True, time()+2); then I redirected page with a header() statement.
The time is set low so I can test it out. I have the following on the redirected page: <?php echo $_COOKIE["grpchk"] ?>
This returns a error: Notice: Undefined index: grpchk in C:\ftproot\ on line 99
So I guess my questions are the following:
How can I test to see if sessions are supported on a server?
What is wrong with my cookie implementation?
Thanks.
I have setup a simpe site that verifies a user and redirects them where they need to go. For the last page I want to setup a session or cookie variable to make sure they have been verified. The session part worked fine on a local server I have. I then uploaded it to my hosting company and it fails. If I try to echo the session variable it blanks the whole page.
I then decided to try cookies. Apparently I do not know how to do this. I used the following to set the cookie: setcookie("grpchk", True, time()+2); then I redirected page with a header() statement.
The time is set low so I can test it out. I have the following on the redirected page: <?php echo $_COOKIE["grpchk"] ?>
This returns a error: Notice: Undefined index: grpchk in C:\ftproot\ on line 99
So I guess my questions are the following:
How can I test to see if sessions are supported on a server?
What is wrong with my cookie implementation?
Thanks.