Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Cookie CGI.pm Linux problem retrieving cookies

by Anonymous Monk
on Nov 11, 2001 at 02:01 UTC ( #124603=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

We just switched from solaris to Linux for our ecommerce site and cookies are not working. The code to retrieve a cookie does not work. Any ideas?
  • Comment on Cookie CGI.pm Linux problem retrieving cookies

Replies are listed 'Best First'.
Re: Cookie CGI.pm Linux problem retrieving cookies
by Ovid (Cardinal) on Nov 11, 2001 at 03:11 UTC

    We need much more information before we can begin to debug this. When someone says they moved a site and cookies have broken, there are a couple of things that usually occur. Here's some typical code (using CGI.pm) to create and set a cookie:

    my $cookie = $q->cookie( -name => 'session', -value => '123456', -expires => '+1h', -path => '/cgi-bin/admin/', -domain => '.somehost.com', -secure => 1); print $q->header( -cookie => $cookie );

    Here's what usually happens to screw that up.

    • The domain is different or you're using an IP address which causes the cookie to fail. The cookie will only be returned if the domain specified matches. If your cookie domain is '.host.com' and the site is 'www.host.com', the cookie will be returned. If the cookie domain is 'www.host.com' and the site is 'host.com', you will get no cookie.
    • The site gets reconfigured so that the path information is no longer the same. If /cgi-cin/admin/ is now /cgi-bin/management/ and that's the path specification, your cookies will not be returned.
    • The secure switch is set, but the site is no longer running on SSL. I recently had an administrative console break because we moved the site and someone forgot to get an SSL certificate, so they just turned off SSL. My site breaking was a Good Thing.

    If this doesn't answer your question, post the code that sets the cookie and the code that retrieves the cookie, along with relevant path and domain info.

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Re: Cookie CGI.pm Linux problem retrieving cookies
by dws (Chancellor) on Nov 11, 2001 at 02:12 UTC
    We just switched from solaris to Linux for our ecommerce site and cookies are not working. The code to retrieve a cookie does not work. Any ideas?

    That's not a lot to go on. Please give us more details.

    What version of Perl are you moving off of? What version are you moving to?

    What version of CGI.pm are you moving off of? What version are you moving to?

    Did the move change the network topology from the site's perspective? Specifically, is there now a different proxy server or firewall between the site and customers? (Some firewalls can be configured to block cookies).

    From a customer's point of view (out there in DNS-land), did the site's domain name change? That could certainly cause cookie problems, particularly if the site is configured to set cookies under a different domain name that is different from what the browser is responding to.

Re: Cookie CGI.pm Linux problem retrieving cookies
by Zaxo (Archbishop) on Nov 11, 2001 at 02:12 UTC

    Nope.

    What's the code say? Error logs? Did you check paths?

    After Compline,
    Zaxo

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://124603]
Approved by root
help
Chatterbox?
[Corion]: ambrus: Hehe ;) Yeah - such real life stuff is far more inconveniencing than wasting display area due to screen ratio problems :)
[ambrus]: Corion: yes, it's a bit tricky. you can try to adjust the slides live to cover only a part of the screen, but it's still hard.
[ambrus]: Corion: two very hard things about presentations I should try to work on if I have twenty times as much free time as in real life are:
[Corion]: That's why I like HTML - it makes it relatively easy to resize stuff. Resizing with Powerpoint is much harder, or at least, I remember it being that way
[ambrus]: (a) good sans serif fonts optimized for slides in a projector with coverage of the symbols needed for mathematical formulas in a sans serif font matching the text font well, and
[ambrus]: (b) a good presentation system that lets the presenter quickly interactively edit the slides live during a presentation, to combine the advantages of blackboard and overhead slide styles in modern tech
[Corion]: Heh - in university, I cheated on (a) by doing blackboard presentations using chalk. But those were 2 hour presentations, not quick/essential/ reduced presentations where you want to show something quick
[ambrus]: (either on just one screen or two screens). this is necessary because
[ambrus]: overhead slide plus blackboard is inconvenient because the lighting conditions are different and they require separate areas you can't quickly repartition, and typing on keyboard is faster and more convenient than writing on a blackboard
[Corion]: (b) would be cool. I've thought about this doing Pod editing, and even simply regenerating/live updating the browser makes things much more interactive

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (12)
As of 2017-09-26 10:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (293 votes). Check out past polls.

    Notices?