cookie problems
| From: | clay bond | Date: | Sun, 06 Aug 2000 00:01:41 +0000 |
| Subject: | cookie problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-10284@lists.php.net to get a copy of this message | ||
We're developing a site for a mandatory two-course
sequence, with about 25K-29K students a semester.
Because of the number of hits, we're using the
university server (and authorization); we're just
using REMOTE_USER on our site to customize the data
on the page for the student. No problem there at all.
However, the gradebook app is running on another
server (MS SQL on NT, using coldfusion), and since
it is *not* the campus web server, it cannot access
their .htpasswd file. Yet, students who want to see
their grades must be authenticated.
The obvious solution was for us to set a cookie
when they login. When they go to the gradebook
server, the app can read the cookie and authenticate
them. Here's what we've done (php is installed as
a cgi wrapper on the univ server):
#!/usr/local/bin/php3
setcookie("tuna",$REMOTE_USER,time()+3600);
The major problem is that no cookie is being written
to the hard drive. So we added the expiry above, but
still no cookie on the drive. Why not?
The minor problem is that we want the cookie to be
passed no matter what domain the client is. Many of
our students either use a local ISP (not the univ),
and now that cable modem service is available, more
and more students will have that. If we leave out
the domain, it defaults to the same as the server.
How can we specify that the cookie is to be passed
no matter where the connection is from?