Computer Webmaster Gaming Console Graphics Forum

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.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > PHP
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

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.

Google
Closed Thread
 
LinkBack Thread Tools Display Modes
Old 07-01-2007, 4:00 PM   #1
Phil Powell
 
Phil Powell's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default TCL, PHP and cookies - AUGH!

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


 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Advertisements
Old 07-01-2007, 4:00 PM   #2
Nikolai Chuvakhin
 
Nikolai Chuvakhin's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default TCL, PHP and cookies - AUGH!

"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
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-01-2007, 4:00 PM   #3
Phil Powell
 
Phil Powell's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default TCL, PHP and cookies - AUGH!

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



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-01-2007, 4:11 PM   #4
MeerKat
 
MeerKat's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default TCL, PHP and cookies - AUGH!

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

 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-01-2007, 4:14 PM   #5
Volkmar Stegmann
 
Volkmar Stegmann's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default TCL, PHP and cookies - AUGH!

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
>



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Featured Websites
Free Space
Free Space
Free Space Free Space
Closed Thread
Tags: , , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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




All times are GMT +1. The time now is 11:56 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98