Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    Junior Member
    Join Date
    Apr 2005
    Location
    N. Wilkesboro, NC
    Posts
    1
    Member #
    9634
    Wasn't sure where to post this question, since it spans 2 different languages...

    I've been a Perl programmer for about 8 years, and although I've used PHP for several years, I don't have as much experience with it.

    I'm writing a Private Messaging program for my site, and it uses Cookies to show the user whether they have a new message waiting for them.

    I'm using Perl for a lot of my site, and it's using LWP::Simple to import a PHP header file. By itself, the header file recognizes the cookie, and the Perl file recognizes the cookie when I call it directly from the script. The problem, though, is that once the PHP file is imported, it doesn't recognize the cookie anymore.

    Man, this is tough to explain. It's like this:

    PHP THAT WORKS:
    if ($_COOKIE['user']) echo "this works";
    else echo "no cookie";

    Returns: this works


    PERL THAT WORKS:
    getCookies(); #(my own function that splits $ENV{'HTTP_COOKIE'}
    if ($cookies{'user'}) { print "this works"; }
    else { print "no cookie"; }

    Returns: this works


    PERL THAT DOESN'T WORK
    use LWP::Simple;
    $header = get("header.php"); #this would import the PHP script that I wrote above

    Returns: no cookie


    The cookie is being set in Perl with:
    print "Set-Cookie: user=$username; path=/; expires=$expires\n";

    Any ideas?

  2.  


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:22 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com