Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: chop and CGI.pm cookie problem?

by michellem (Friar)
on Jul 31, 2003 at 19:30 UTC ( [id://279740]=note: print w/replies, xml ) Need Help??


in reply to Re: chop and CGI.pm cookie problem?
in thread chop and CGI.pm cookie problem?

Um, I'm missing something here. $meta_configs{login_cookie_expiration} is going to hold something like 15m, or 1d, or 3h.
So if I chop that, I should get: $time_frame = "d" or "h" or "m"
and $meta_configs{login_cookie_expiration} = some_numeric_value that I use to figure out expiration.
I never use that variable again after this routine, so destroying it is of no consequence. And, if I do the following:
my $exp = $meta_configs{login_cookie_expiration}; my $time_frame = chop($exp);

(and replace $exp in the place of the meta_config variable in the later lines), I get the same problem.
Also, the default (if, for some reason, the meta_config variable is kerfluxed) is to set an expiration date of one hour, and return to the main routine, so worst case scenario should simply be 1 hour expirations for the session, not no cookies set.

Replies are listed 'Best First'.
Re: Re: Re: chop and CGI.pm cookie problem?
by antirice (Priest) on Jul 31, 2003 at 20:09 UTC

    ...but it IS of consequence if you thrash $meta_configs{login_cookie_expiration} because you use it two lines after get_timestamp is called.

    If you replaced everything within get_timestamp in that way, it should work. The problem is that if you set -expires to 1 (after being chopped from 1h) then the cookie expires immediately. If you would like to see what exactly is going on try connecting to your webserver on port 80 and type in a valid request for the script and see what the head says. If the cookie that the page returns says that it expires Thu, 01-Jan-1970 00:00:01 GMT, then you are using an invalid expiration representation in $meta_configs{login_cookie_expiration} (which is the variable you use for expires). Try printing $meta_configs{login_cookie_expiration} to the page's output. If it doesn't end with s,m,h,d,M, or y, isn't "now", and isn't a fully qualified date, then CGI happily sets the expires to Thu, 01-Jan-1970 00:00:01 GMT.

    If you could post the new version of get_timestamp as well as what $meta_configs{login_cookie_expiration} contains, we'd be more than happy to help.

    antirice    
    The first rule of Perl club is - use Perl
    The
    ith rule of Perl club is - follow rule i - 1 for i > 1

      I get it now. I was totally missing what you were saying at first. Sorry about that. You're right - I used that variable again later! Yow. My bad.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-20 00:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found