Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #13979 > unrolled thread

problem with cookies

Started byCODEY <ed.pataky@gmail.com>
First post2012-05-14 19:08 -0700
Last post2012-05-15 18:53 +0000
Articles 8 — 6 participants

Back to article view | Back to comp.lang.javascript


Contents

  problem with cookies CODEY <ed.pataky@gmail.com> - 2012-05-14 19:08 -0700
    Re: problem with cookies Swifty <steve.j.swift@gmail.com> - 2012-05-15 07:59 +0100
      Re: problem with cookies Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-05-15 11:09 -0700
        Re: problem with cookies Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-05-15 20:21 +0200
          Re: problem with cookies Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-05-15 12:43 -0700
            Re: problem with cookies Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-05-16 13:53 +0200
              OT: What is your "Face" graphic? Mike Duffy <Use_guestbook_page@website.in.sig> - 2012-05-16 23:42 +0000
        Re: problem with cookies "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-05-15 18:53 +0000

#13979 — problem with cookies

FromCODEY <ed.pataky@gmail.com>
Date2012-05-14 19:08 -0700
Subjectproblem with cookies
Message-ID<6510212.125.1337047703032.JavaMail.geo-discussion-forums@vbli11>
Hi .. i have a problem .. i set a cookie with www.domain.com, and for some reason if the user goes to my website at domain.com without the www, a cookie is set without the www, and i can no longer read the cookie with the www ... why is this?  what can i do?

[toc] | [next] | [standalone]


#13981

FromSwifty <steve.j.swift@gmail.com>
Date2012-05-15 07:59 +0100
Message-ID<mbv3r75ak29dev3vqcdhoi90g4lg642g38@4ax.com>
In reply to#13979
On Mon, 14 May 2012 19:08:23 -0700 (PDT), CODEY <ed.pataky@gmail.com>
wrote:

>why is this?  

www.domain.com and domain.com could be entirely separate systems, as
are www.swifys.org.uk (on a commercial server somewhere) and
swiftys.org.uk (on my home PC where I'm typing this) 

Cookies are typically recorded against the name of the host providing
the page.

You could set a cross-domain cookie but many people reject these, so
your process would become rather hit-and-miss.

>what can i do?

One approach would be to store the data on your server, rather in
cookies in the user's browser.

Alternatively, you could arrange to redirect requests for domain.com
to www.domain.com

-- 
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk

[toc] | [prev] | [next] | [standalone]


#13994

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-05-15 11:09 -0700
Message-ID<TZwsr.9505$TC4.4301@newsfe14.iad>
In reply to#13981
On 5/14/12 11:59 PM, Swifty wrote:
> On Mon, 14 May 2012 19:08:23 -0700 (PDT), CODEY<ed.pataky@gmail.com>
> wrote:
>
>> why is this?
>
> www.domain.com and domain.com could be entirely separate systems, as
> are www.swifys.org.uk (on a commercial server somewhere) and
> swiftys.org.uk (on my home PC where I'm typing this)
>
> Cookies are typically recorded against the name of the host providing
> the page.
>
> You could set a cross-domain cookie but many people reject these, so
> your process would become rather hit-and-miss.
>
>> what can i do?
>
> One approach would be to store the data on your server, rather in
> cookies in the user's browser.
>
> Alternatively, you could arrange to redirect requests for domain.com
> to www.domain.com
>
I think alternatively you could set the cookie domain to ".domain.com", 
which includes "domain.com" and "www.domain.com", as well as 
"blah.domain.com".

[toc] | [prev] | [next] | [standalone]


#13995

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-05-15 20:21 +0200
Message-ID<8744287.J7NaK4W3va@PointedEars.de>
In reply to#13994
Daniel Pitts wrote:

> Swifty wrote:
>> Alternatively, you could arrange to redirect requests for [example.com]
>> to [www.example.com]
>
> I think alternatively you could set the cookie domain to [".example.com"],
> which includes ["example.com"] and ["www.example.com"], as well as
> ["blah.example.com"].

According to my tests, that is equivalent to setting the domain to 
"example.com".

(You should not use potentially existing domain names for examples, see 
RFC 2606.)


PointedEars
-- 
    realism:    HTML 4.01 Strict
    evangelism: XHTML 1.0 Strict
    madness:    XHTML 1.1 as application/xhtml+xml
                                                    -- Bjoern Hoehrmann

[toc] | [prev] | [next] | [standalone]


#13997

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-05-15 12:43 -0700
Message-ID<jlysr.4$Oh3.2@newsfe12.iad>
In reply to#13995
On 5/15/12 11:21 AM, Thomas 'PointedEars' Lahn wrote:
> (You should not use potentially existing domain names for examples, see
> RFC 2606.)

I was using the domain that the OP used, without knowing whether or not 
they meant literally "domain.com", or if they indeed were using that as 
an example.

[toc] | [prev] | [next] | [standalone]


#14014

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-05-16 13:53 +0200
Message-ID<1403100.AFRqVoOGUt@PointedEars.de>
In reply to#13997
Daniel Pitts wrote:

> On 5/15/12 11:21 AM, Thomas 'PointedEars' Lahn wrote:
>> (You should not use potentially existing domain names for examples, see
>> RFC 2606.)
> 
> I was using the domain that the OP used, without knowing whether or not
> they meant literally "domain.com", or if they indeed were using that as
> an example.

It is rather obvious to me that the OP also was not aware of this 
recommendation.  Visit <http://www.domain.com/> and WHOIS domain.com
to see for yourself.


PointedEars
-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

[toc] | [prev] | [next] | [standalone]


#14021 — OT: What is your "Face" graphic?

FromMike Duffy <Use_guestbook_page@website.in.sig>
Date2012-05-16 23:42 +0000
SubjectOT: What is your "Face" graphic?
Message-ID<XnsA055C86FC1B61invalidcom@94.75.214.39>
In reply to#14014
I just noticed your "Face" graphic. What is it?

It seems vaguely familiar.

-- 
http://pages.videotron.ca/duffym/index.htm

[toc] | [prev] | [next] | [standalone]


#13996

From"Evertjan." <exjxw.hannivoort@interxnl.net>
Date2012-05-15 18:53 +0000
Message-ID<XnsA054D48175206eejj99@194.109.133.133>
In reply to#13994
Daniel Pitts wrote on 15 mei 2012 in comp.lang.javascript:

> On 5/14/12 11:59 PM, Swifty wrote:
>> On Mon, 14 May 2012 19:08:23 -0700 (PDT), CODEY<ed.pataky@gmail.com>
>> wrote:
>>
>>> why is this?
>>
>> www.domain.com and domain.com could be entirely separate systems, as
>> are www.swifys.org.uk (on a commercial server somewhere) and
>> swiftys.org.uk (on my home PC where I'm typing this)
>>
>> Cookies are typically recorded against the name of the host providing
>> the page.
>>
>> You could set a cross-domain cookie but many people reject these, so
>> your process would become rather hit-and-miss.
>>
>>> what can i do?
>>
>> One approach would be to store the data on your server, rather in
>> cookies in the user's browser.
>>
>> Alternatively, you could arrange to redirect requests for domain.com
>> to www.domain.com
>>
> I think alternatively you could set the cookie domain to ".domain.com", 
> which includes "domain.com" and "www.domain.com", as well as 
> "blah.domain.com".

Setting the domain to 'www.example.com' will make the cookie available in 
the www subdomain and higher subdomains. Cookies available to a lower 
domain, such as 'example.com' will be available to higher subdomains, such 
as 'www.example.com'. 

Older browsers still implementing the deprecated ť RFC 2109 may require a 
leading . to match all subdomains.

[not tested]

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web