Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8030551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:48:25+00:00 2026-06-05T00:48:25+00:00

So I am creating cookies using Perl’s CGI module, and I do it as

  • 0

So I am creating cookies using Perl’s CGI module, and I do it as so:

my $cookie = CGI::Cookie->new(-name    =>  "$name",
                         -value   =>  "$val",
                         -expires =>  "$expiration_date",
                         -path    =>  $cookie_path,
                         -secure  =>  0
                        );

print "Set-Cookie: $cookie\n";

And the cookie is set in the browser, the only issue is that the time does not match up with the expiration date I put. For example, if I put +1d for expiration date, it really does something like +1d – several hours. I checked my system time to see if that was the issue, but my system time is right. Then I printed out the cookie and I got this:

Actual Time of cookie creation: 6/4/2012 12:10:02 PM    
COOKIE: session_id=534fec49c864d8cf0325779b0921b6be1338829802484; path=/; expires=Tue, 05-Jun-2012 17:10:02 GMT

The strage thing above is that I record the actual time of cookie creation with perl’s ‘localtime(time())’ function, but it records a different time than what my date command puts out (so not the actual current time)! And then the expiration time on the cookie is actually correct, but it’s in the wrong time zone.

So my server is in the eastern timezone when I run the date command:

Mon Jun  4 12:05:12 EST 2012

However, the cookie is being set with GMT as the timezone, and I think this is the issue. Is there another time I should be setting on the server besides just date? I’m running on CentOS 5 if that helps at all. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T00:48:26+00:00Added an answer on June 5, 2026 at 12:48 am

    Those times are actually equivalent (12:00 EST is 17:00 GMT). Note that cookies are required, by the specification, to specify the expiry time in GMT. Your browser, in turn, is required to automatically convert the time zone back.

    In so many words: everything is happening as it should.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating an array to store in cookie using jquery.cookies.js Below is the
I'm using FormsAuthentication (with cookies) for users authentication, with the default cookie name (.ASPXAUTH).
We're creating a new consumer/public-facing ASP.Net web app. There are two concerns: --Use cookie
I am creating forms authentication cookies using the following code: string formsCookieStr = string.Empty;
im practicing on creating a html using jquery cookies. i already know how to
I am creating cookie using jquery, please see below code: var divID = $(link).next(.open-block-holder).find(div:first).attr(id);
I am creating a cookie and storing the value of username after succesfull login.
hey people i'm using a jquery plugin for creating cookies which seems to be
I am creating the cookie using the code below, How to read the txtusername
I am creating some cookies in my ASP.NET application. These cookies expire 10 minutes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.