Results 1 to 3 of 3

Thread: Weird Cookies in Safari

  1. #1
    Join Date
    Aug 2006

    Question Weird Cookies in Safari

    I have no where else to turn for help. My ISP support recommended I post this on some discussion boards so I thought I'd see y'all think. I've been working on this for several hours, and I can't seem to find any error that I've made. Any help you can provide will be very welcomed.

    On one of my websites, we have a perl library that is not working in Macintosh Safari..

    There are subroutines in this file that are called from several other files. I should note that everything works fine in other browsers, just not Safari.

    The subroutine in this file simply reads two cookies that have been stored when users login and places that info in a variable. The problem is that this isn't working -- the script returns an empty string. It does not return the cookies set. I can see that the cookies are set -- it's just a matter of reading them back into a variable.

    Here's the code from the library file:
    my $thequery = new CGI;
    my $thecookie1 = $thequery->cookie("name");
    my $thecookie2 = $thequery->cookie("other");

    Simple enough -- the problem is that $thcookie1 and $thecookie2 are blank once this part of the code is executed. I know this because to test, I added an "if-then" statement to check (not to mention simply calling a print of the variables). Yet, I can see that the cookies have been set, and they are visible in the cookies window (safari->preferences->security).

    In my Perl scripts that call this subroutine, I do include "use CGI;" -- BTW, it's not returning any error string when executed. Simply, these variables are empty!

    What's weird is that I also administer another website in a completely different account, but same ISP. Many of my Perl scripts are identical. I also have the same lib on this website as well and it works great without any problems. This is the weird part -- same file, housed at same ISP, works in one account but not the other.

    Because I thought there might be something wrong with my file, I tried many things including simply copying the file from website2 to website1 via FTP (ie, two simulteneous FTP connections). This also yielded no results.

    I've also tested this on multiple machines and with multiple connections -- ie., it's not a single-client issue from what I can tell. My only guess is ... well, at this point, I have no guess....

    thanks in advance for help.

  2. #2
    Join Date
    Dec 2002
    Pleasanton, CA
    Something to try...
    If you are not alreading doing it, include a path in your cookie when you write it.

    my $cookie1 = "name=$name;path=/";
    my $cookie2 = "other=$other;path=/";

  3. #3
    Join Date
    Aug 2006

    Talking Thanks

    Yeah -- it's working now. Thanks for all of your help-

    In case you're interested, the issue was this:

    The cookie was being set to "http://domain.org" -- ie., without the "www." in the address
    and the scripts were calling "http://www.domain.org/cgi-bin/etc...."

    Because of this, Safari was thinking the cookie was from another site -- hows abouts that mac security!

    One freakin' line of code solved the problem. When I set the cookie now, i simply added an option of the CGI pm:


    voila! it's workin' now. Thanks again for your help-you gave me the idea to set the cookies with the path!!!
    Last edited by bigcomposer; 08-29-2006 at 05:22 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.15772 seconds
  • Memory Usage 2,844KB
  • Queries Executed 13 (?)
More Information
Template Usage (32):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (3)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates