Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Cookie in IE7

 
   Database Help (Home) -> PHP RSS
Next:  Data Validation  
Author Message
Pankaj

External


Since: Nov 29, 2007
Posts: 10



(Msg. 1) Posted: Thu Oct 09, 2008 7:11 am
Post subject: Cookie in IE7
Archived from groups: comp>lang>php (more info?)

I have st a cookie that would last for 30 days. If I put a line <img
src="http://www.example.com/readcookie.php" width="1" height="1"> in a
php file, I cannot read the cookie if I use IE7. However, it works in
Firefox and Chrome. If I try to access the URL http://www.example.com/readcookie.php
in IE7, I am able to read the cookie then.

I am using the following lines of code

to set the cookie

setcookie("TestCookie",$userid,time()+(60*60*24*30),"/"); -------------
> Sets the cookie

to read the cookie

$MyUserId = $_COOKIE['TestCookie']; -------------------------> Sets
the variable $MyUserId if I try to access the file containg this code
in browser. However, this code does not work if I include the file
containing this code.

 >> Stay informed about: Cookie in IE7 
Back to top
Login to vote
R. Rajesh Jeba Anb1

External


Since: Jun 15, 2004
Posts: 49



(Msg. 2) Posted: Thu Oct 09, 2008 10:21 am
Post subject: Re: Cookie in IE7 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Pankaj wrote:
> I have st a cookie that would last for 30 days. If I put a line <img
> src="http://www.example.com/readcookie.php" width="1" height="1"> in a
> php file, I cannot read the cookie if I use IE7. However, it works in
> Firefox and Chrome. If I try to access the URL http://www.example.com/readcookie.php
> in IE7, I am able to read the cookie then.
>
> I am using the following lines of code
>
> to set the cookie
>
> setcookie("TestCookie",$userid,time()+(60*60*24*30),"/"); -------------
> > Sets the cookie
>
> to read the cookie
>
> $MyUserId = $_COOKIE['TestCookie']; -------------------------> Sets
> the variable $MyUserId if I try to access the file containg this code
> in browser. However, this code does not work if I include the file
> containing this code.

When setting the cookie from server, it would require that you
reload the page. http://in2.php.net/setcookie

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

 >> Stay informed about: Cookie in IE7 
Back to top
Login to vote
R. Rajesh Jeba Anb1

External


Since: Jun 15, 2004
Posts: 49



(Msg. 3) Posted: Thu Oct 09, 2008 10:32 am
Post subject: Re: Cookie in IE7 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Oct 9, 10:25 pm, Jerry Stuckle <jstuck....DeleteThis@attglobal.net> wrote:
> Pankaj wrote:
<snip>
> Why are you trying to read a cookie with an <img> tag? That doesn't
> make any sense.

Possibly, he's spying his users (stats).

<OT>
How is life and economy going?
</OT>

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/
 >> Stay informed about: Cookie in IE7 
Back to top
Login to vote
R. Rajesh Jeba Anb1

External


Since: Jun 15, 2004
Posts: 49



(Msg. 4) Posted: Thu Oct 09, 2008 10:39 am
Post subject: Re: Cookie in IE7 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Oct 9, 10:32 pm, "R. Rajesh Jeba Anbiah"
<ng4rrjanb... RemoveThis @rediffmail.com> wrote:
> On Oct 9, 10:25 pm, Jerry Stuckle <jstuck... RemoveThis @attglobal.net> wrote:
>
> > Pankaj wrote:
> <snip>
> > Why are you trying to read a cookie with an <img> tag? That doesn't
> > make any sense.
>
> Possibly, he's spying his users (stats).
>
> <OT>
> How is life and economy going?
> </OT>

Disregard OT, I thought I was replying to Geof

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/
 >> Stay informed about: Cookie in IE7 
Back to top
Login to vote
Jerry Stuckle

External


Since: Aug 11, 2004
Posts: 3463



(Msg. 5) Posted: Thu Oct 09, 2008 1:25 pm
Post subject: Re: Cookie in IE7 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Pankaj wrote:
> I have st a cookie that would last for 30 days. If I put a line <img
> src="http://www.example.com/readcookie.php" width="1" height="1"> in a
> php file, I cannot read the cookie if I use IE7. However, it works in
> Firefox and Chrome. If I try to access the URL http://www.example.com/readcookie.php
> in IE7, I am able to read the cookie then.
>
> I am using the following lines of code
>
> to set the cookie
>
> setcookie("TestCookie",$userid,time()+(60*60*24*30),"/"); -------------
>> Sets the cookie
>
> to read the cookie
>
> $MyUserId = $_COOKIE['TestCookie']; -------------------------> Sets
> the variable $MyUserId if I try to access the file containg this code
> in browser. However, this code does not work if I include the file
> containing this code.
>
>
>

Why are you trying to read a cookie with an <img> tag? That doesn't
make any sense.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex.DeleteThis@attglobal.net
==================
 >> Stay informed about: Cookie in IE7 
Back to top
Login to vote
Geoff Berrow1

External


Since: Dec 24, 2003
Posts: 351



(Msg. 6) Posted: Thu Oct 09, 2008 2:26 pm
Post subject: Re: Cookie in IE7 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Message-ID:
<aafee92c-0550-480a-9672-981904193479 DeleteThis @n33g2000pri.googlegroups.com> from
R. Rajesh Jeba Anbiah contained the following:

>> <OT>
>> How is life and economy going?
>> </OT>
>
> Disregard OT, I thought I was replying to Geof

Smile

Mail me and we can catch up (use the address in the sig), Haven't seen
you post for ages..
--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
http://slipperyhill.co.uk - http://4theweb.co.uk
 >> Stay informed about: Cookie in IE7 
Back to top
Login to vote
Michael Fesser

External


Since: Dec 17, 2007
Posts: 867



(Msg. 7) Posted: Thu Oct 09, 2008 4:25 pm
Post subject: Re: Cookie in IE7 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

..oO(Jerry Stuckle)

>Pankaj wrote:
>> I have st a cookie that would last for 30 days. If I put a line <img
>> src="http://www.example.com/readcookie.php" width="1" height="1"> in a
>> php file, I cannot read the cookie if I use IE7. However, it works in
>> Firefox and Chrome. If I try to access the URL http://www.example.com/readcookie.php
>> in IE7, I am able to read the cookie then.
>>
>> I am using the following lines of code
>>
>> to set the cookie
>>
>> setcookie("TestCookie",$userid,time()+(60*60*24*30),"/"); -------------
>>> Sets the cookie
>>
>> to read the cookie
>>
>> $MyUserId = $_COOKIE['TestCookie']; -------------------------> Sets
>> the variable $MyUserId if I try to access the file containg this code
>> in browser. However, this code does not work if I include the file
>> containing this code.
>>
>>
>>
>
>Why are you trying to read a cookie with an <img> tag? That doesn't
>make any sense.

It does. An HTTP request is an HTTP request, it doesn't matter if the
return is an HTML page or an image. If for example there's an image-
generating script, there might also be the need for reading some cookie
value, maybe the preferred image size or something like that.

In my own case some images can be delivered by a script from a protected
directory. Authentication is handled with a cookie-based session, so the
request for such an image _must_ contain the session cookie or the image
won't be delivered, because the authentication fails.

Micha
 >> Stay informed about: Cookie in IE7 
Back to top
Login to vote
Pankaj

External


Since: Nov 29, 2007
Posts: 10



(Msg. 8) Posted: Thu Oct 09, 2008 10:38 pm
Post subject: Re: Cookie in IE7 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Oct 10, 1:16 am, Michael Fesser <neti....TakeThisOut@gmx.de> wrote:
> .oO(Jerry Stuckle)
>
>
>
> >Pankaj wrote:
> >> I have st a cookie that would last for 30 days. If I put a line <img
> >> src="http://www.example.com/readcookie.php" width="1" height="1"> in a
> >> php file, I cannot read the cookie if I use IE7. However, it works in
> >> Firefox and Chrome. If I try to access the URLhttp://www.example.com/readcookie.php
> >> in IE7,  I am able to read the cookie then.
>
> >> I am using the following lines of code
>
> >> to set the cookie
>
> >> setcookie("TestCookie",$userid,time()+(60*60*24*30),"/"); -------------
> >>> Sets the cookie
>
> >> to read the cookie
>
> >> $MyUserId = $_COOKIE['TestCookie']; -------------------------> Sets
> >> the variable $MyUserId if I try to access the file containg this code
> >> in browser. However, this code does not work if I include the file
> >> containing this code.
>
> >Why are you trying to read a cookie with an <img> tag?  That doesn't
> >make any sense.
>
> It does. An HTTP request is an HTTP request, it doesn't matter if the
> return is an HTML page or an image. If for example there's an image-
> generating script, there might also be the need for reading some cookie
> value, maybe the preferred image size or something like that.
>
> In my own case some images can be delivered by a script from a protected
> directory. Authentication is handled with a cookie-based session, so the
> request for such an image _must_ contain the session cookie or the image
> won't be delivered, because the authentication fails.
>
> Micha

I am tracking how many users from my site visited one of my partner
site and signed up there. AFAIK, I do not have another way of finding
this out. I do not think it is an issue with authentication because
the code works if the user agent is firefox/ opera/ chrome.

Pankaj
 >> Stay informed about: Cookie in IE7 
Back to top
Login to vote
Jerry Stuckle

External


Since: Aug 11, 2004
Posts: 3463



(Msg. 9) Posted: Fri Oct 10, 2008 7:52 am
Post subject: Re: Cookie in IE7 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Pankaj wrote:
> On Oct 10, 1:16 am, Michael Fesser <neti....DeleteThis@gmx.de> wrote:
>> .oO(Jerry Stuckle)
>>
>>
>>
>>> Pankaj wrote:
>>>> I have st a cookie that would last for 30 days. If I put a line <img
>>>> src="http://www.example.com/readcookie.php" width="1" height="1"> in a
>>>> php file, I cannot read the cookie if I use IE7. However, it works in
>>>> Firefox and Chrome. If I try to access the URLhttp://www.example.com/readcookie.php
>>>> in IE7, I am able to read the cookie then.
>>>> I am using the following lines of code
>>>> to set the cookie
>>>> setcookie("TestCookie",$userid,time()+(60*60*24*30),"/"); -------------
>>>>> Sets the cookie
>>>> to read the cookie
>>>> $MyUserId = $_COOKIE['TestCookie']; -------------------------> Sets
>>>> the variable $MyUserId if I try to access the file containg this code
>>>> in browser. However, this code does not work if I include the file
>>>> containing this code.
>>> Why are you trying to read a cookie with an <img> tag? That doesn't
>>> make any sense.
>> It does. An HTTP request is an HTTP request, it doesn't matter if the
>> return is an HTML page or an image. If for example there's an image-
>> generating script, there might also be the need for reading some cookie
>> value, maybe the preferred image size or something like that.
>>
>> In my own case some images can be delivered by a script from a protected
>> directory. Authentication is handled with a cookie-based session, so the
>> request for such an image _must_ contain the session cookie or the image
>> won't be delivered, because the authentication fails.
>>
>> Micha
>
> I am tracking how many users from my site visited one of my partner
> site and signed up there. AFAIK, I do not have another way of finding
> this out. I do not think it is an issue with authentication because
> the code works if the user agent is firefox/ opera/ chrome.
>
> Pankaj
>

Are both of these sites in the same domain?

This type of failure is usually caused by a higher security setting in
IE than the others.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex.DeleteThis@attglobal.net
==================
 >> Stay informed about: Cookie in IE7 
Back to top
Login to vote
Pankaj

External


Since: Nov 29, 2007
Posts: 10



(Msg. 10) Posted: Fri Oct 10, 2008 6:31 pm
Post subject: Re: Cookie in IE7 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Rajesh, the page is reloaded. I tried to read the cookie after the
user has filled up a two page form



R. Rajesh Jeba Anbiah wrote:
> Pankaj wrote:
> > I have st a cookie that would last for 30 days. If I put a line <img
> > src="http://www.example.com/readcookie.php" width="1" height="1"> in a
> > php file, I cannot read the cookie if I use IE7. However, it works in
> > Firefox and Chrome. If I try to access the URL http://www.example.com/readcookie.php
> > in IE7, I am able to read the cookie then.
> >
> > I am using the following lines of code
> >
> > to set the cookie
> >
> > setcookie("TestCookie",$userid,time()+(60*60*24*30),"/"); -------------
> > > Sets the cookie
> >
> > to read the cookie
> >
> > $MyUserId = $_COOKIE['TestCookie']; -------------------------> Sets
> > the variable $MyUserId if I try to access the file containg this code
> > in browser. However, this code does not work if I include the file
> > containing this code.
>
> When setting the cookie from server, it would require that you
> reload the page. http://in2.php.net/setcookie
>
> --
> <?php echo 'Just another PHP saint'; ?>
> Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/
 >> Stay informed about: Cookie in IE7 
Back to top
Login to vote
Pankaj

External


Since: Nov 29, 2007
Posts: 10



(Msg. 11) Posted: Fri Oct 10, 2008 6:32 pm
Post subject: Re: Cookie in IE7 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Yes they are on the same domain

Jerry Stuckle wrote:
> Pankaj wrote:
> > On Oct 10, 1:16 am, Michael Fesser <neti... DeleteThis @gmx.de> wrote:
> >> .oO(Jerry Stuckle)
> >>
> >>
> >>
> >>> Pankaj wrote:
> >>>> I have st a cookie that would last for 30 days. If I put a line <img
> >>>> src="http://www.example.com/readcookie.php" width="1" height="1"> in a
> >>>> php file, I cannot read the cookie if I use IE7. However, it works in
> >>>> Firefox and Chrome. If I try to access the URLhttp://www.example.com/readcookie.php
> >>>> in IE7, I am able to read the cookie then.
> >>>> I am using the following lines of code
> >>>> to set the cookie
> >>>> setcookie("TestCookie",$userid,time()+(60*60*24*30),"/"); -------------
> >>>>> Sets the cookie
> >>>> to read the cookie
> >>>> $MyUserId = $_COOKIE['TestCookie']; -------------------------> Sets
> >>>> the variable $MyUserId if I try to access the file containg this code
> >>>> in browser. However, this code does not work if I include the file
> >>>> containing this code.
> >>> Why are you trying to read a cookie with an <img> tag? That doesn't
> >>> make any sense.
> >> It does. An HTTP request is an HTTP request, it doesn't matter if the
> >> return is an HTML page or an image. If for example there's an image-
> >> generating script, there might also be the need for reading some cookie
> >> value, maybe the preferred image size or something like that.
> >>
> >> In my own case some images can be delivered by a script from a protected
> >> directory. Authentication is handled with a cookie-based session, so the
> >> request for such an image _must_ contain the session cookie or the image
> >> won't be delivered, because the authentication fails.
> >>
> >> Micha
> >
> > I am tracking how many users from my site visited one of my partner
> > site and signed up there. AFAIK, I do not have another way of finding
> > this out. I do not think it is an issue with authentication because
> > the code works if the user agent is firefox/ opera/ chrome.
> >
> > Pankaj
> >
>
> Are both of these sites in the same domain?
>
> This type of failure is usually caused by a higher security setting in
> IE than the others.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstucklex DeleteThis @attglobal.net
> ==================
 >> Stay informed about: Cookie in IE7 
Back to top
Login to vote
David Quinton

External


Since: Oct 08, 2007
Posts: 16



(Msg. 12) Posted: Sat Oct 11, 2008 3:25 am
Post subject: Re: Cookie in IE7 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 10 Oct 2008 18:32:46 -0700 (PDT), Pankaj <panahuja.RemoveThis@gmail.com>
wrote:

>Yes they are on the same domain

and subdomain (i.e. both have "www")?
--
Free personal divertable Phone number: <http://www.bizorg.co.uk/personalnos.htm>
 >> Stay informed about: Cookie in IE7 
Back to top
Login to vote
R. Rajesh Jeba Anb1

External


Since: Jun 15, 2004
Posts: 49



(Msg. 13) Posted: Mon Oct 13, 2008 7:17 pm
Post subject: Re: Cookie in IE7 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Oct 11, 6:31 am, Pankaj <panah....DeleteThis@gmail.com> wrote:
> Rajesh, the page is reloaded. I tried to read the cookie after the
> user has filled up a two page form

Check the status bar--if it's been denied by the policy settings.
Probably your domain name or cookie name might be a trouble. Also, try
setting P3P policy header http://www.sitepoint.com/print/p3p-cookies-ie6/

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/
 >> Stay informed about: Cookie in IE7 
Back to top
Login to vote
Display posts from previous:   
   Database Help (Home) -> PHP All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]