Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Cookies and 'accept only from server'

by Xxaxx (Monk)
on Aug 15, 2001 at 23:28 UTC ( [id://105148]=perlquestion: print w/replies, xml ) Need Help??

Xxaxx has asked for the wisdom of the Perl Monks concerning the following question:

As a technique to avoid profiling and other general weirdness many browsers have an option to only accept cookies from the webpage's server.

In banner program I'm sending the standard "domain=.myhost.com". This is fine and dandy and the script runs just fine as long as the browser is requesting pages of the form http://www.myhost.com/webpage.html

If the browser requests a page such as http://myhost.com/webpage.html and the "accept cookies only from server" option is activated then no cookie is set.

While only 5% of my traffic is of the type http://myhost.com it is preferred to have a solution which will set cookies for those requests as well.

Has anyone solved this problem?

Thanks in advance
Claude

p.s. I realize that this is not strictly speaking a Perl question. But it's been my experience that perl monks have looked deeper into these issues than your standard webmonkey. So I was hoping someone might have found an answer. And, since whatever the solution is it will be implemented in my Perl script I'm hoping this might be a good forum for the question.

Replies are listed 'Best First'.
Re: Cookies and 'accept only from server'
by gryphon (Abbot) on Aug 15, 2001 at 23:35 UTC

    Greetings,

    What server are you using? You could play around with the server to force all requests from http://myhost.com/ to be redirected to http://www.myhost.com/. It's an icky solution, but in theory it would work.

    Alternately, try dropping the "domain" key/value pair from the cookie and see if the default will set the cookie even on the http://myhost.com/ event.

    -gryphon
    code('Perl') || die;

      Dropping the domain key/value pair seems to work for Opera, Mozilla (0.9.2), and MSIE 5.0

      It does not work for Netscape 4.7

      So it looks like this might be a workable solution since I'll only miss the few Netscape 4.7 users who happen to leave off the www.

      I am nervous though about leaving out the domain key/value pair since it is specified in the cookie specs. But Opera is pretty good about complaining when it receives a 'bad cookie' so maybe it will work okay.

      Thanks for the suggestion.
      Claude

OT - Re: Cookies and 'accept only from server'
by blakem (Monsignor) on Aug 15, 2001 at 23:38 UTC
    Off Topic, But...

    I think that's a browser specific thing... some browsers consider myhost.com part of .myhost.com and some dont. The only way I was able to address this was to disallow requests to myhost.com. Any request to myhost.com was redirected to www.myhost.com with an apache mod_rewrite directive.

    -Blake

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://105148]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2024-04-18 16:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found