Re: cookies and IE
Wouldn't be the first time I've been wrong. I do know that I was seeing inconsistent behavior with cookies not being saved in a redirect page (mostly IE PC, but not 100% of the time), but I didn't spend any time worrying about it because of the previous messages I remembered. A quick check of my mailbox shows a discussion back in March where someone suggested using Refresh instead of Redirect to get around the problem. I recall previous discussions, but I don't have any on file. Actually, I had the same problem with certain versions of IE not setting cookies when they are used with redirects... I ended up making it so that the redirect was unnecessary. After a while I switched to HTTP authentication - In many ways it's even simpler :-) Cheers, -- IT'S TIME FOR A DIFFERENT KIND OF WEB Jean-Michel Hiver - Software Director [EMAIL PROTECTED] +44 (0)114 255 8097 VISIT HTTP://WWW.MKDOC.COM
Re: cookies and IE
On Tue, Oct 01, 2002 at 07:23:39PM -0400, Kee Hinckley wrote: At 11:30 AM -0700 10/1/02, Alan wrote: Hi folks... I'm having a bit of a weird problem with Apache::Cookie and IE. I'm setting a cookie and then doing a redirect as follows: This must come up once every few months. I'd complain about that fact, but the irony is that just last week I couldn't figure out why a new site I was working on wasn't setting cookies in IE and I'd done the same thing I'd read about a dozen times. IE doesn't reliably set cookies on a refresh. I believe the only solution is to rearchitect the site. Interesting... on the several browsers/OSs I had it tested on it seemed to work. Anyway, if this is such a common question, who do you talk to to get it stuck in the perl.apache.org page about cookies? :) alan -- Alan Arcterex [EMAIL PROTECTED] -=][=- http://arcterex.net I used to herd dairy cows. Now I herd lusers. Apart from the isolation, I think I preferred the cows. They were better conversation, easier to milk, and if they annoyed me enough, I could shoot them and eat them. -Rodger Donaldson
Re: cookies and IE
Hi Alan, I guess your mistake is to send the refresh header as http header. You should use a meta tag in html or redirect in http. Sven. On Tue, 1 Oct 2002, Alan wrote: Hi folks... I'm having a bit of a weird problem with Apache::Cookie and IE. I'm setting a cookie and then doing a redirect as follows: my $c = Apache::Cookie-new( $r, -name = 'userdata', -value = $cookie, -expires = '1d', -path = '/dealers' ); $r-content_type('text/html'); $c-bake; $r-header_out(Refresh=0;url=/dealers$request_uri); $r-no_cache(1); $r-send_http_header; $r-print( print_refresh_page_content() ); (print_refresh_page_content() just returns a string of authenticated) After the authenticated message is printed it should refresh back to the /dealers/ URL, except this time the handler will see there is a cookie and print out the real data, not a username/pass prompt. This works *perfectly* in mozilla linux, galeon, mozilla windows, and ie6 under windows XP. It *doesn't* work on ie 6 under win98, winME, or ie 5.5 run through crossover office. It displays the authenticated page, but then refreshes back to the login page. No cookie is set, but debug when setting the cookie shows the following: Set-Cookie=userdata=[data]; path=/dealers; expires=1d at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Refresh=0;url=/dealers/ at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Pragma=no-cache at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Cache-control=no-cache at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Connection=close at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Content-Type=text/html at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Expires=Tue, 01 Oct 2002 18:30:31 GMT at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. This is the same that is printed out when a working browser gets cookies set. I've played around with the security settings, and even at the lowest setting, with IE set to prompt for any cookies, it won't even acknowledge that I'm trying to set a cookie. Anyone have any ideas/solutions/thoughts? -- Sven Geislere-mail: [EMAIL PROTECTED] Senior Developertel:(+49 30) 53 62 16 27
Re: cookies and IE
At 09:02 02.10.2002, Alan wrote: On Tue, Oct 01, 2002 at 07:23:39PM -0400, Kee Hinckley wrote: At 11:30 AM -0700 10/1/02, Alan wrote: Hi folks... I'm having a bit of a weird problem with Apache::Cookie and IE. I'm setting a cookie and then doing a redirect as follows: This must come up once every few months. I'd complain about that fact, but the irony is that just last week I couldn't figure out why a new site I was working on wasn't setting cookies in IE and I'd done the same thing I'd read about a dozen times. IE doesn't reliably set cookies on a refresh. I believe the only solution is to rearchitect the site. Interesting... on the several browsers/OSs I had it tested on it seemed to work. Anyway, if this is such a common question, who do you talk to to get it stuck in the perl.apache.org page about cookies? :) Send some paragraphs detailing this to me (preferably in POD), and it'll be added to the site. -- Per Einar Ellefsen [EMAIL PROTECTED]
Re: cookies and IE
Alan wrote [ 01 October 2002 at 03:09 pm ] On Tue, Oct 01, 2002 at 11:30:59AM -0700, Alan wrote: Turns out the issue was the 'expires' tag... IE wouldn't set the cookie until it was set to '+1d' If setting the expires tag to +1d fixed the problem you may want to look at the time on the machine running IE. I ran into a problem where the clients clock was in the wrong timezone, this of course changed the distance from GMT and caused the cookie to be expired as it was sent. IE did not accept the cookie at all. However once the time was set correctly the cookie worked correctly. -- nicholas l studt [EMAIL PROTECTED]
Re: cookies and IE
On Wed, Oct 02, 2002 at 08:15:23AM -0500, Nicholas Studt wrote: Alan wrote [ 01 October 2002 at 03:09 pm ] On Tue, Oct 01, 2002 at 11:30:59AM -0700, Alan wrote: Turns out the issue was the 'expires' tag... IE wouldn't set the cookie until it was set to '+1d' If setting the expires tag to +1d fixed the problem you may want to look at the time on the machine running IE. I ran into a problem where the clients clock was in the wrong timezone, this of course changed the distance from GMT and caused the cookie to be expired as it was sent. IE did not accept the cookie at all. However once the time was set correctly the cookie worked correctly. Nope... one of the versions of IE that I was running was on the same machine (running through crossover office). Looks like my little problem really had nothing to do with refreshing and setting cookies, but it was actually in the way that parsing works in Apache::Cookie (and CGI/CGI::Cookie). When the expires is set to +3d the cookie is set as follows: Set-Cookie=name=value; path=/path; expires=Sat, 05-Oct-2002 15:10:06 GMT But when it's set to 3d the cookie is set as: Set-Cookie=name=value; path=/path; expires=3d Which makes sense, but it's a very subtle thing IMHO, and to me 1d means expire in one day, the same as +1d. Anything think that this deserves a bug report, or chalk it up to stupid user syndrome? Alan -- Alan Arcterex [EMAIL PROTECTED] -=][=- http://arcterex.net I used to herd dairy cows. Now I herd lusers. Apart from the isolation, I think I preferred the cows. They were better conversation, easier to milk, and if they annoyed me enough, I could shoot them and eat them. -Rodger Donaldson
Re: cookies and IE
But when it's set to 3d the cookie is set as: Set-Cookie=name=value; path=/path; expires=3d Which makes sense, but it's a very subtle thing IMHO, and to me 1d means expire in one day, the same as +1d. Anything think that this deserves a bug report, or chalk it up to stupid user syndrome? the logic in apache_request.c seems to indicate that you get options +time, -time, and 'now'. any other formats (such as 1d) get the literal string in the cookie. untested, though :) the Apache::Cookie manpage says it's a CGI::Cookie emulation, where CGI::Cookie says to see CGI.pm for acceptable -expires values, which doesn't say much except illustrate that + and - and 'now' are permissible values. so, it's not really a bug if you dig down into the docs and examples. looks like a feature, though :) I can't think of a reason why you'd want a literal in the expires field, but I don't use cookies all that much, so maybe there are some cases where it's desirable. maybe $cookie should be undef, or the cookie should default to browser-session-only if -expires doesn't follow the standard format? maybe that's a question for [EMAIL PROTECTED] --Geoff
Re: cookies and IE
On Wed, Oct 02, 2002 at 01:21:49PM -0400, Geoffrey Young wrote: so, it's not really a bug if you dig down into the docs and examples. looks like a feature, though :) Agreed... more of a 'gotcha' though, ready to bite people in the butt. Personally I think it might make more sense to do a check to see if the val =~ /(\d+)(h|m|d|M)/ before it's sent off as a literal, but who knows. I'll email someone about it anyway. alan -- Alan Arcterex [EMAIL PROTECTED] -=][=- http://arcterex.net I used to herd dairy cows. Now I herd lusers. Apart from the isolation, I think I preferred the cows. They were better conversation, easier to milk, and if they annoyed me enough, I could shoot them and eat them. -Rodger Donaldson
Re: cookies and IE
At 20:12 02.10.2002, Alan wrote: On Wed, Oct 02, 2002 at 01:21:49PM -0400, Geoffrey Young wrote: so, it's not really a bug if you dig down into the docs and examples. looks like a feature, though :) Agreed... more of a 'gotcha' though, ready to bite people in the butt. Personally I think it might make more sense to do a check to see if the val =~ /(\d+)(h|m|d|M)/ before it's sent off as a literal, but who knows. I'll email someone about it anyway. It's because you can put a correctly formatted date string in the -expires option, AFAIK. So if using your idea, the literal string might be misinterpreted. Also, don't forget that you have +1d and -1d as another possibility. I think the +/- makes sense. It's just one character :) -- Per Einar Ellefsen [EMAIL PROTECTED]
Re: cookies and IE
On Wed, Oct 02, 2002 at 08:30:54PM +0200, Per Einar Ellefsen wrote: At 20:12 02.10.2002, Alan wrote: On Wed, Oct 02, 2002 at 01:21:49PM -0400, Geoffrey Young wrote: so, it's not really a bug if you dig down into the docs and examples. looks like a feature, though :) Agreed... more of a 'gotcha' though, ready to bite people in the butt. Personally I think it might make more sense to do a check to see if the val =~ /(\d+)(h|m|d|M)/ before it's sent off as a literal, but who knows. I'll email someone about it anyway. It's because you can put a correctly formatted date string in the -expires option, AFAIK. So if using your idea, the literal string might be misinterpreted. Also, don't forget that you have +1d and -1d as another possibility. I think the +/- makes sense. It's just one character :) Oh, totally agreed, I just figured that it might be a good way to set a default if there was no + or -, which could eliminate headaches for people like me :) Also, as there's no chance of a correctly formatted date string being \d(h|m|d|etc), it could be a fair assumption. My $0.02 anyway! :) alan -- Alan Arcterex [EMAIL PROTECTED] -=][=- http://arcterex.net I used to herd dairy cows. Now I herd lusers. Apart from the isolation, I think I preferred the cows. They were better conversation, easier to milk, and if they annoyed me enough, I could shoot them and eat them. -Rodger Donaldson
Re: cookies and IE
At 9:29 AM +0200 10/2/02, Sven Geisler wrote: Hi Alan, Hi Kee, I would say Kee is wrong. In our application, the development of which I am involved in, for a special case we need to write a cookie and redirect to another page. Wouldn't be the first time I've been wrong. I do know that I was seeing inconsistent behavior with cookies not being saved in a redirect page (mostly IE PC, but not 100% of the time), but I didn't spend any time worrying about it because of the previous messages I remembered. A quick check of my mailbox shows a discussion back in March where someone suggested using Refresh instead of Redirect to get around the problem. I recall previous discussions, but I don't have any on file. The typical case here is that the user goes to page a, you redirect them to page b for authentication, they submit their password and the password page then sets a cookie and sends them back to a. It may be that the problem was a coding one rather than a browser one. I just tore out the code and instead decided to internally display page b without doing a a redirect. So your URL is for a, but the content is the login page (b). On submit page sees a successful login, sets the cookie, and displays itself. EmpberlObject made this trivial to do, and it ended up meaning less server roundtrips and less code. -- Kee Hinckley - Somewhere.Com, LLC http://consulting.somewhere.com/ I'm not sure which upsets me more: that people are so unwilling to accept responsibility for their own actions, or that they are so eager to regulate everyone else's.
cookies and IE
Hi folks... I'm having a bit of a weird problem with Apache::Cookie and IE. I'm setting a cookie and then doing a redirect as follows: my $c = Apache::Cookie-new( $r, -name = 'userdata', -value = $cookie, -expires = '1d', -path = '/dealers' ); $r-content_type('text/html'); $c-bake; $r-header_out(Refresh=0;url=/dealers$request_uri); $r-no_cache(1); $r-send_http_header; $r-print( print_refresh_page_content() ); (print_refresh_page_content() just returns a string of authenticated) After the authenticated message is printed it should refresh back to the /dealers/ URL, except this time the handler will see there is a cookie and print out the real data, not a username/pass prompt. This works *perfectly* in mozilla linux, galeon, mozilla windows, and ie6 under windows XP. It *doesn't* work on ie 6 under win98, winME, or ie 5.5 run through crossover office. It displays the authenticated page, but then refreshes back to the login page. No cookie is set, but debug when setting the cookie shows the following: Set-Cookie=userdata=[data]; path=/dealers; expires=1d at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Refresh=0;url=/dealers/ at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Pragma=no-cache at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Cache-control=no-cache at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Connection=close at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Content-Type=text/html at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Expires=Tue, 01 Oct 2002 18:30:31 GMT at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. This is the same that is printed out when a working browser gets cookies set. I've played around with the security settings, and even at the lowest setting, with IE set to prompt for any cookies, it won't even acknowledge that I'm trying to set a cookie. Anyone have any ideas/solutions/thoughts? -- Alan Arcterex [EMAIL PROTECTED] -=][=- http://arcterex.net I used to herd dairy cows. Now I herd lusers. Apart from the isolation, I think I preferred the cows. They were better conversation, easier to milk, and if they annoyed me enough, I could shoot them and eat them. -Rodger Donaldson
Re: cookies and IE
On Tue, Oct 01, 2002 at 11:30:59AM -0700, Alan wrote: Hi folks... I'm having a bit of a weird problem with Apache::Cookie and IE. I'm setting a cookie and then doing a redirect as follows: my $c = Apache::Cookie-new( $r, -name = 'userdata', -value = $cookie, -expires = '1d', -path = '/dealers' ); $r-content_type('text/html'); $c-bake; $r-header_out(Refresh=0;url=/dealers$request_uri); $r-no_cache(1); $r-send_http_header; $r-print( print_refresh_page_content() ); Turns out the issue was the 'expires' tag... IE wouldn't set the cookie until it was set to '+1d' alan -- Alan Arcterex [EMAIL PROTECTED] -=][=- http://arcterex.net I used to herd dairy cows. Now I herd lusers. Apart from the isolation, I think I preferred the cows. They were better conversation, easier to milk, and if they annoyed me enough, I could shoot them and eat them. -Rodger Donaldson
Re: cookies and IE
At 11:30 AM -0700 10/1/02, Alan wrote: Hi folks... I'm having a bit of a weird problem with Apache::Cookie and IE. I'm setting a cookie and then doing a redirect as follows: This must come up once every few months. I'd complain about that fact, but the irony is that just last week I couldn't figure out why a new site I was working on wasn't setting cookies in IE and I'd done the same thing I'd read about a dozen times. IE doesn't reliably set cookies on a refresh. I believe the only solution is to rearchitect the site. -- Kee Hinckley - Somewhere.Com, LLC http://consulting.somewhere.com/ I'm not sure which upsets me more: that people are so unwilling to accept responsibility for their own actions, or that they are so eager to regulate everyone else's.
RE: Cookies and IE in mod_perl
I've determined that it isn't the redirect causing the cookies not to be set. If I take out the redirect, and just try to set a cookie w/o a redirect, it still doesn't set the cookies in IE. Does M$ have any docs on how IE6 handles cookies that I can look this up on? YES, they do. You have to setup the Privacy Policy, which means you have to have a P3P header coming out of your webserver with each request. You'll want to lookup the details and docs, and PLEASE customize for your own website, but... *I* fixed this by adding this to my httpd.conf (and I got it from this mailing list anyway :-): # P3P Policy (required for IE6 to accept our cookies) Header add P3P CP=\NOI DSP COR CURa PSDa OUR NOR NAV STA\ This requires mod_headers to be loaded or compiled into Apache. Good luck! L8r, Rob #!/usr/bin/perl -w use Disclaimer qw/:standard/;
Re: Cookies and IE in mod_perl
I've determined that it isn't the redirect causing the cookies not to be set. If I take out the redirect, and just try to set a cookie w/o a redirect, it still doesn't set the cookies in IE. Does M$ have any docs on how IE6 handles cookies that I can look this up on? On Saturday 23 March 2002 11:48 pm, Cees Hek wrote: Some browsers don't accept cookies sent allong with a redirect header. A simple workaround is to leave your cookie in the header, but move the redirect to a META HTTP-EQUIV tag in a blank HTML document. I'm not sure if IE 6.0 suffers from this but I suspect that this is your problem. So this isn't really a mod_perl problem, but likely a browser problem. Also, if you want to see exactly what headers your apache server is sending out, or headers your client is sending in, have a look at Apache::DumpHeaders. It saves putting those warn statements in your code. Cees On Sun, 2002-03-24 at 14:44, Jesse and Rebecca Stay wrote: Ok - I got rid of the Apache::Cookie stuff, and am now doing things manually, but it still doesn't generate a cookie in IE. It still works in Netscape. I get a redirect, but no cookie. Here is my code: my $r = Apache-request; $r-content_type('text/html'); $r-err_headers_out-add('Set-Cookie' = 'userSession=test; domain=.hainesfamily.org; path=/; expires=Mon, 25-Mar-2002 03:30:43 GMT'); $r-headers_out-add(Location = $redir); $r-status(REDIRECT); $r-send_http_header; my $headers_out = $r-headers_out; foreach (keys %$headers_out) { warn $_=$headers_out-{$_}; } return OK; The warn produces the following: Set-Cookie=userSession=test; domain=.domain.org; path=/; expires=Mon, 25-Mar-2002 03:30:43 GMT at /path/to/script.pm line 326. Location=/r/common/loginWelcome at /path/to/script.pm line 326. Connection=close at /path/to/script.pm line 326. Transfer-Encoding=chunked at /path/to/script.pm line 326. Content-Type=text/html at /path/to/script.pm line 326. Am I doing something wrong??? -Jesse Stay On Saturday 23 March 2002 06:43 pm, Eric Frazier wrote: Strong suggestion. Look at an existing cookie that works in IE whatever, copy it, then look at the header that Apache::Cookie is making. This oop cookie crap really bugs me since a cookie is just a stupid header line, not that big of a deal to parse, or write by hand. Abscraction is for things that make good objects and that are HARD, cookies in my opinon don't fit into that category. I strongly bet it has to do with the expire date, also look at the docs, and the code itself under the expires sub. I haven't done e com crap for a while now, but I had lots of trouble getting IE to get it right. Remember Netscape invented the cookie, then IE had to go and tweak with it. Eric At 09:21 PM 3/23/02 -0500, Jesse and Rebecca Stay wrote: I guess in particular, does anyone know of any known issues with Apache::Cookie and IE6.0 (or any other versions)? On Saturday 23 March 2002 07:09 pm, Jesse and Rebecca Stay wrote: Here is the code I use (in this particular case it is being used with a redirect, but it doesn't work in any case.): my $cookieContent = Apache::Cookie-new( $r, -name= 'userSession', -value = $cookieValue, -expires = '+365d'); $cookieContent-bake(); $r-headers_out-set(Location = $redir); $r-status(REDIRECT); $r-send_http_header; return OK; I tried expires = '+1Y', but that didn't work either. Adding the domain doesn't do anything either. On Saturday 23 March 2002 06:44 pm, Frank Wiles wrote: On Sat, 23 Mar 2002 18:52:14 -0500 Jesse and Rebecca Stay [EMAIL PROTECTED] wrote: Has anyone had any issues in getting cookies to work with IE using mod_perl? I have tried using both CGI::Cookie and Apache::Cookie, and in both instances it works just fine under Netscape, but on IE it doesn't even try to set the cookie. Any ideas? What are you expire times on your cookies? We ran into a situation where I work that all of the Windows machines were in the wrong time zone and with a 2 hour expire, IE would not set the cookie because it thought it was already expired. Netscape would however set the cookie anyway. This may not be your problem, but it may be something to think about. - Frank Wiles [EMAIL PROTECTED] http://frank.wiles.org - http://www.kwinternet.com/eric (250) 655 - 9513 (PST Time Zone)
Re: Cookies and IE in mod_perl
On Sat, 23 Mar 2002, Jesse and Rebecca Stay wrote: Ok - I got rid of the Apache::Cookie stuff, and am now doing things manually, but it still doesn't generate a cookie in IE. It still works in Netscape. I get a redirect, but no cookie. Here is my code: my $r = Apache-request; $r-content_type('text/html'); $r-err_headers_out-add('Set-Cookie' = 'userSession=test; domain=.hainesfamily.org; path=/; expires=Mon, 25-Mar-2002 03:30:43 GMT'); $r-headers_out-add(Location = $redir); $r-status(REDIRECT); $r-send_http_header; my $headers_out = $r-headers_out; foreach (keys %$headers_out) { warn $_=$headers_out-{$_}; } return OK; I think this should be return 302;
Re: Cookies and IE in mod_perl
On Sun, Mar 24, 2002 at 01:44:51PM -0500, Jesse and Rebecca Stay wrote: I've determined that it isn't the redirect causing the cookies not to be set. If I take out the redirect, and just try to set a cookie w/o a redirect, it still doesn't set the cookies in IE. Does M$ have any docs on how IE6 handles cookies that I can look this up on? http://www.microsoft.com/presspass/press/2001/mar01/PrivacyToolsIEfs.asp Balazs
Cookies and IE in mod_perl
Has anyone had any issues in getting cookies to work with IE using mod_perl? I have tried using both CGI::Cookie and Apache::Cookie, and in both instances it works just fine under Netscape, but on IE it doesn't even try to set the cookie. Any ideas? -Jesse Stay
Fw: Re: Cookies and IE in mod_perl
On Sat, 23 Mar 2002 18:52:14 -0500 Jesse and Rebecca Stay [EMAIL PROTECTED] wrote: Has anyone had any issues in getting cookies to work with IE using mod_perl? I have tried using both CGI::Cookie and Apache::Cookie, and in both instances it works just fine under Netscape, but on IE it doesn't even try to set the cookie. Any ideas? What are you expire times on your cookies? We ran into a situation where I work that all of the Windows machines were in the wrong time zone and with a 2 hour expire, IE would not set the cookie because it thought it was already expired. Netscape would however set the cookie anyway. This may not be your problem, but it may be something to think about. - Frank Wiles [EMAIL PROTECTED] http://frank.wiles.org -
Re: Cookies and IE in mod_perl
Here is the code I use (in this particular case it is being used with a redirect, but it doesn't work in any case.): my $cookieContent = Apache::Cookie-new( $r, -name= 'userSession', -value = $cookieValue, -expires = '+365d'); $cookieContent-bake(); $r-headers_out-set(Location = $redir); $r-status(REDIRECT); $r-send_http_header; return OK; I tried expires = '+1Y', but that didn't work either. Adding the domain doesn't do anything either. On Saturday 23 March 2002 06:44 pm, Frank Wiles wrote: On Sat, 23 Mar 2002 18:52:14 -0500 Jesse and Rebecca Stay [EMAIL PROTECTED] wrote: Has anyone had any issues in getting cookies to work with IE using mod_perl? I have tried using both CGI::Cookie and Apache::Cookie, and in both instances it works just fine under Netscape, but on IE it doesn't even try to set the cookie. Any ideas? What are you expire times on your cookies? We ran into a situation where I work that all of the Windows machines were in the wrong time zone and with a 2 hour expire, IE would not set the cookie because it thought it was already expired. Netscape would however set the cookie anyway. This may not be your problem, but it may be something to think about. - Frank Wiles [EMAIL PROTECTED] http://frank.wiles.org -
Re: Cookies and IE in mod_perl
I guess in particular, does anyone know of any known issues with Apache::Cookie and IE6.0 (or any other versions)? On Saturday 23 March 2002 07:09 pm, Jesse and Rebecca Stay wrote: Here is the code I use (in this particular case it is being used with a redirect, but it doesn't work in any case.): my $cookieContent = Apache::Cookie-new( $r, -name= 'userSession', -value = $cookieValue, -expires = '+365d'); $cookieContent-bake(); $r-headers_out-set(Location = $redir); $r-status(REDIRECT); $r-send_http_header; return OK; I tried expires = '+1Y', but that didn't work either. Adding the domain doesn't do anything either. On Saturday 23 March 2002 06:44 pm, Frank Wiles wrote: On Sat, 23 Mar 2002 18:52:14 -0500 Jesse and Rebecca Stay [EMAIL PROTECTED] wrote: Has anyone had any issues in getting cookies to work with IE using mod_perl? I have tried using both CGI::Cookie and Apache::Cookie, and in both instances it works just fine under Netscape, but on IE it doesn't even try to set the cookie. Any ideas? What are you expire times on your cookies? We ran into a situation where I work that all of the Windows machines were in the wrong time zone and with a 2 hour expire, IE would not set the cookie because it thought it was already expired. Netscape would however set the cookie anyway. This may not be your problem, but it may be something to think about. - Frank Wiles [EMAIL PROTECTED] http://frank.wiles.org -
Re: Cookies and IE in mod_perl
Ok - I got rid of the Apache::Cookie stuff, and am now doing things manually, but it still doesn't generate a cookie in IE. It still works in Netscape. I get a redirect, but no cookie. Here is my code: my $r = Apache-request; $r-content_type('text/html'); $r-err_headers_out-add('Set-Cookie' = 'userSession=test; domain=.hainesfamily.org; path=/; expires=Mon, 25-Mar-2002 03:30:43 GMT'); $r-headers_out-add(Location = $redir); $r-status(REDIRECT); $r-send_http_header; my $headers_out = $r-headers_out; foreach (keys %$headers_out) { warn $_=$headers_out-{$_}; } return OK; The warn produces the following: Set-Cookie=userSession=test; domain=.domain.org; path=/; expires=Mon, 25-Mar-2002 03:30:43 GMT at /path/to/script.pm line 326. Location=/r/common/loginWelcome at /path/to/script.pm line 326. Connection=close at /path/to/script.pm line 326. Transfer-Encoding=chunked at /path/to/script.pm line 326. Content-Type=text/html at /path/to/script.pm line 326. Am I doing something wrong??? -Jesse Stay On Saturday 23 March 2002 06:43 pm, Eric Frazier wrote: Strong suggestion. Look at an existing cookie that works in IE whatever, copy it, then look at the header that Apache::Cookie is making. This oop cookie crap really bugs me since a cookie is just a stupid header line, not that big of a deal to parse, or write by hand. Abscraction is for things that make good objects and that are HARD, cookies in my opinon don't fit into that category. I strongly bet it has to do with the expire date, also look at the docs, and the code itself under the expires sub. I haven't done e com crap for a while now, but I had lots of trouble getting IE to get it right. Remember Netscape invented the cookie, then IE had to go and tweak with it. Eric At 09:21 PM 3/23/02 -0500, Jesse and Rebecca Stay wrote: I guess in particular, does anyone know of any known issues with Apache::Cookie and IE6.0 (or any other versions)? On Saturday 23 March 2002 07:09 pm, Jesse and Rebecca Stay wrote: Here is the code I use (in this particular case it is being used with a redirect, but it doesn't work in any case.): my $cookieContent = Apache::Cookie-new( $r, -name= 'userSession', -value = $cookieValue, -expires = '+365d'); $cookieContent-bake(); $r-headers_out-set(Location = $redir); $r-status(REDIRECT); $r-send_http_header; return OK; I tried expires = '+1Y', but that didn't work either. Adding the domain doesn't do anything either. On Saturday 23 March 2002 06:44 pm, Frank Wiles wrote: On Sat, 23 Mar 2002 18:52:14 -0500 Jesse and Rebecca Stay [EMAIL PROTECTED] wrote: Has anyone had any issues in getting cookies to work with IE using mod_perl? I have tried using both CGI::Cookie and Apache::Cookie, and in both instances it works just fine under Netscape, but on IE it doesn't even try to set the cookie. Any ideas? What are you expire times on your cookies? We ran into a situation where I work that all of the Windows machines were in the wrong time zone and with a 2 hour expire, IE would not set the cookie because it thought it was already expired. Netscape would however set the cookie anyway. This may not be your problem, but it may be something to think about. - Frank Wiles [EMAIL PROTECTED] http://frank.wiles.org - http://www.kwinternet.com/eric (250) 655 - 9513 (PST Time Zone)
Re: Fw: Re: Cookies and IE in mod_perl
There are different security levels that must be set. You can also specifically tell the browser to accept all cookies from a particular domain. There is an article on MS site about this. I forgot what it was. You can probably search for it on google. Frank Wiles wrote: [EMAIL PROTECTED]"> On Sat, 23 Mar 2002 18:52:14 -0500 Jesse and Rebecca Stay [EMAIL PROTECTED] wrote: Has anyone had any issues in getting cookies to work with IE using mod_perl? I have tried using both CGI::Cookie and Apache::Cookie, and in both instances it works just fine under Netscape, but on IE it doesn't even try to set the cookie. Any ideas? What are you expire times on your cookies? We ran into a situation where I work that all of the Windows machines were in the wrong time zoneand with a 2 hour expire, IE would not set the cookie because it thought it was already expired. Netscape would however set the cookie anyway.This may not be your problem, but it may be something to think about. - Frank Wiles [EMAIL PROTECTED] http://frank.wiles.org -
Re: Cookies and IE in mod_perl
Some browsers don't accept cookies sent allong with a redirect header. A simple workaround is to leave your cookie in the header, but move the redirect to a META HTTP-EQUIV tag in a blank HTML document. I'm not sure if IE 6.0 suffers from this but I suspect that this is your problem. So this isn't really a mod_perl problem, but likely a browser problem. Also, if you want to see exactly what headers your apache server is sending out, or headers your client is sending in, have a look at Apache::DumpHeaders. It saves putting those warn statements in your code. Cees On Sun, 2002-03-24 at 14:44, Jesse and Rebecca Stay wrote: Ok - I got rid of the Apache::Cookie stuff, and am now doing things manually, but it still doesn't generate a cookie in IE. It still works in Netscape. I get a redirect, but no cookie. Here is my code: my $r = Apache-request; $r-content_type('text/html'); $r-err_headers_out-add('Set-Cookie' = 'userSession=test; domain=.hainesfamily.org; path=/; expires=Mon, 25-Mar-2002 03:30:43 GMT'); $r-headers_out-add(Location = $redir); $r-status(REDIRECT); $r-send_http_header; my $headers_out = $r-headers_out; foreach (keys %$headers_out) { warn $_=$headers_out-{$_}; } return OK; The warn produces the following: Set-Cookie=userSession=test; domain=.domain.org; path=/; expires=Mon, 25-Mar-2002 03:30:43 GMT at /path/to/script.pm line 326. Location=/r/common/loginWelcome at /path/to/script.pm line 326. Connection=close at /path/to/script.pm line 326. Transfer-Encoding=chunked at /path/to/script.pm line 326. Content-Type=text/html at /path/to/script.pm line 326. Am I doing something wrong??? -Jesse Stay On Saturday 23 March 2002 06:43 pm, Eric Frazier wrote: Strong suggestion. Look at an existing cookie that works in IE whatever, copy it, then look at the header that Apache::Cookie is making. This oop cookie crap really bugs me since a cookie is just a stupid header line, not that big of a deal to parse, or write by hand. Abscraction is for things that make good objects and that are HARD, cookies in my opinon don't fit into that category. I strongly bet it has to do with the expire date, also look at the docs, and the code itself under the expires sub. I haven't done e com crap for a while now, but I had lots of trouble getting IE to get it right. Remember Netscape invented the cookie, then IE had to go and tweak with it. Eric At 09:21 PM 3/23/02 -0500, Jesse and Rebecca Stay wrote: I guess in particular, does anyone know of any known issues with Apache::Cookie and IE6.0 (or any other versions)? On Saturday 23 March 2002 07:09 pm, Jesse and Rebecca Stay wrote: Here is the code I use (in this particular case it is being used with a redirect, but it doesn't work in any case.): my $cookieContent = Apache::Cookie-new( $r, -name= 'userSession', -value = $cookieValue, -expires = '+365d'); $cookieContent-bake(); $r-headers_out-set(Location = $redir); $r-status(REDIRECT); $r-send_http_header; return OK; I tried expires = '+1Y', but that didn't work either. Adding the domain doesn't do anything either. On Saturday 23 March 2002 06:44 pm, Frank Wiles wrote: On Sat, 23 Mar 2002 18:52:14 -0500 Jesse and Rebecca Stay [EMAIL PROTECTED] wrote: Has anyone had any issues in getting cookies to work with IE using mod_perl? I have tried using both CGI::Cookie and Apache::Cookie, and in both instances it works just fine under Netscape, but on IE it doesn't even try to set the cookie. Any ideas? What are you expire times on your cookies? We ran into a situation where I work that all of the Windows machines were in the wrong time zone and with a 2 hour expire, IE would not set the cookie because it thought it was already expired. Netscape would however set the cookie anyway. This may not be your problem, but it may be something to think about. - Frank Wiles [EMAIL PROTECTED] http://frank.wiles.org - http://www.kwinternet.com/eric (250) 655 - 9513 (PST Time Zone)