![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| Ok now it has turned to the bizarre. In /cma/index.php, which sets the cookie: setcookie('username', $username, time() + 600); .... header("Location..."); It redirects to the TCL CGI /cma_main.cgi which in turns does NOT see the cookie name "username" ever set. I go to my /Phil/Cookies folder for the cookie under the "valsignalandet.com" domain and, sure enough, "username" is not set. However, $HTTP_COOKIE_VARS["username"] DOES exist every time I go to /cma/index.php thereafter, in spite of nothing else showing a cookie exists. So, in short, "setcookie()" in PHP is setting a nonexistent cookie. Phil ----- Original Message ----- From: "Chris Snyder" <csnyder@chxo.com> To: "NYPHP Talk" <talk@lists.nyphp.org> Sent: Thursday, July 31, 2003 1:36 PM Subject: Re: [nyphp-talk] TCL, PHP and cookies - AUGH! > In fact, if $env(SERVER_NAME) works, I'd try $env(HTTP_COOKIE) and see > what it comes up with. > > Chris Snyder wrote: > > > The key to finding the cookie in TCL might be the $env list? > > > > > > _______________________________________________ > talk mailing list > talk@lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk _______________________________________________ talk mailing list talk@lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk | |||
| Advertisements |
| | #2 | ||
| "Phil Powell" <soazine@erols.com> wrote in message news:<tydWa.36$cf.33@lakeread04>... > > In /cma/index.php, which sets the cookie: > > setcookie('username', $username, time() + 600); > ... > header("Location..."); > > It redirects to the TCL CGI /cma_main.cgi which in turns does NOT > see the cookie name "username" ever set. Which is exactly what should be happening. Since you omitted the optional 'path' argument, the cookie is set for the current directory (in your case, /cma). When you try to read the cookie from the root directory, nothing happens, because your cookie is not set for the root directory... It's all in the docs, read 'em: http://php.net/setcookie Cheers, NC | |||
| | #3 | ||
| Well, I added the path '/' to setcookie, to no avail. Same problem; Cookie did not appear in the browser cookie file nor anywhere else, yet $HTTP_COOKIE_VARS["username"] exists... The PHP script is on a Linux server too BTW.. Phil "Nikolai Chuvakhin" <nc@iname.com> wrote in message news:32d7a63c.0307311349.7ba5edc9@posting.google.c om... > "Phil Powell" <soazine@erols.com> wrote in message > news:<tydWa.36$cf.33@lakeread04>... > > > > In /cma/index.php, which sets the cookie: > > > > setcookie('username', $username, time() + 600); > > ... > > header("Location..."); > > > > It redirects to the TCL CGI /cma_main.cgi which in turns does NOT > > see the cookie name "username" ever set. > > Which is exactly what should be happening. Since you omitted > the optional 'path' argument, the cookie is set for the current > directory (in your case, /cma). When you try to read the cookie > from the root directory, nothing happens, because your cookie > is not set for the root directory... > > It's all in the docs, read 'em: > > http://php.net/setcookie > > Cheers, > NC | |||
| | #4 | ||
| Try setting your browser to ask for confirmation before setting the cookie (Mozilla is good for cookie management) and see if setcookie really is working. Additionally, confirm that your system clock is the same as the server clock. Cookies will only be returned by the browser back to the script if it thinks its not expired, so a system clock 10 minutes faster than a server clock (or the other way round) will cause problems... Phil Powell wrote: > Ok now it has turned to the bizarre. > > In /cma/index.php, which sets the cookie: > > setcookie('username', $username, time() + 600); > ... > header("Location..."); > > It redirects to the TCL CGI /cma_main.cgi which in turns does NOT see the > cookie name "username" ever set. I go to my /Phil/Cookies folder for the > cookie under the "valsignalandet.com" domain and, sure enough, "username" is > not set. However, $HTTP_COOKIE_VARS["username"] DOES exist every time I go > to /cma/index.php thereafter, in spite of nothing else showing a cookie > exists. > > So, in short, "setcookie()" in PHP is setting a nonexistent cookie. > > Phil > ----- Original Message ----- > From: "Chris Snyder" <csnyder@chxo.com> > To: "NYPHP Talk" <talk@lists.nyphp.org> > Sent: Thursday, July 31, 2003 1:36 PM > Subject: Re: [nyphp-talk] TCL, PHP and cookies - AUGH! > > > >>In fact, if $env(SERVER_NAME) works, I'd try $env(HTTP_COOKIE) and see >>what it comes up with. >> >>Chris Snyder wrote: >> >> >>>The key to finding the cookie in TCL might be the $env list? >>> >>> >> >>______________________________________________ _ >>talk mailing list >>talk@lists.nyphp.org >>http://lists.nyphp.org/mailman/listinfo/talk > > > _______________________________________________ > talk mailing list > talk@lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > -- MeerKat | |||
| | #5 | ||
| Hi, I've the same problem on my LAMP Server. I set the cookie with setcookie and path "/" in a directore /Logon. Everything works fine within that directory (the cookie is found). But when trying to get the cookie in f.e. /Events/Wedding it's not there (but set in the browser). This seems to be a problem for PHP Session management as well because session_start() is also not identifying the session created in the /Logon folder..... regs Volkmar "MeerKat" <liquidlaughter2000@blueyonder.co.uk> wrote in message news:URgWa.38$Dz1.11@news-binary.blueyonder.co.uk... > Try setting your browser to ask for confirmation before setting the > cookie (Mozilla is good for cookie management) and see if setcookie > really is working. > > Additionally, confirm that your system clock is the same as the server > clock. Cookies will only be returned by the browser back to the script > if it thinks its not expired, so a system clock 10 minutes faster than a > server clock (or the other way round) will cause problems... > > > > Phil Powell wrote: > > > Ok now it has turned to the bizarre. > > > > In /cma/index.php, which sets the cookie: > > > > setcookie('username', $username, time() + 600); > > ... > > header("Location..."); > > > > It redirects to the TCL CGI /cma_main.cgi which in turns does NOT see the > > cookie name "username" ever set. I go to my /Phil/Cookies folder for the > > cookie under the "valsignalandet.com" domain and, sure enough, "username" is > > not set. However, $HTTP_COOKIE_VARS["username"] DOES exist every time I go > > to /cma/index.php thereafter, in spite of nothing else showing a cookie > > exists. > > > > So, in short, "setcookie()" in PHP is setting a nonexistent cookie. > > > > Phil > > ----- Original Message ----- > > From: "Chris Snyder" <csnyder@chxo.com> > > To: "NYPHP Talk" <talk@lists.nyphp.org> > > Sent: Thursday, July 31, 2003 1:36 PM > > Subject: Re: [nyphp-talk] TCL, PHP and cookies - AUGH! > > > > > > > >>In fact, if $env(SERVER_NAME) works, I'd try $env(HTTP_COOKIE) and see > >>what it comes up with. > >> > >>Chris Snyder wrote: > >> > >> > >>>The key to finding the cookie in TCL might be the $env list? > >>> > >>> > >> > >>______________________________________________ _ > >>talk mailing list > >>talk@lists.nyphp.org > >>http://lists.nyphp.org/mailman/listinfo/talk > > > > > > _______________________________________________ > > talk mailing list > > talk@lists.nyphp.org > > http://lists.nyphp.org/mailman/listinfo/talk > > > > > > -- > MeerKat > | |||
| Featured Websites | ||||
|
![]() |
| Tags: augh, cookies, php, tcl |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cookies... Help Please ! | ewolfe | PHP | 1 | 07-01-2007 3:55 PM |
| Cookies... Help Please ! | E-Star | PHP | 1 | 07-01-2007 3:55 PM |
| How to pass data to HTML page without cookies? | Robert Oschler | PHP | 1 | 07-01-2007 3:37 PM |
| 20% Commissions!! 90 Day Cookies!! Mega Cool Stuff!! | Webmaster@MegaCoolStuff.com | Affiliate Programs | 0 | 06-12-2007 7:58 PM |
| Featured Websites | ||||
|