Time in a cookie.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • fb

    Time in a cookie.

    Hi everyone. I'm planning to store the current date and time in a
    cookie and then compare, the time in the cookie to the current time. If
    30 minutes elapses, then I will ... I dunno ... redirect to another
    page I guess.

    My question is ... How do I store the current date and time in a
    cookie? If you can think of other ways of monitoring the time, so that
    I can countdown properly even with a page refresh, let me know...

    Thanks.

    --
    "The race for quality has no finish line - so technically, it's more
    like a death march."
  • Joost Diepenmaat

    #2
    Re: Time in a cookie.

    fb <fb@noway.comwr ites:
    Hi everyone. I'm planning to store the current date and time in a
    cookie and then compare, the time in the cookie to the current time.
    If 30 minutes elapses, then I will ... I dunno ... redirect to another
    page I guess.
    Unless you're proposing to redirect people off your site after half an
    hour of actively browsing it (and why not, I'm sure they'd come back),
    you've not thought this through.

    --
    Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/

    Comment

    • fb

      #3
      Re: Time in a cookie.

      Joost Diepenmaat wrote:
      fb <fb@noway.comwr ites:
      >
      >Hi everyone. I'm planning to store the current date and time in a
      >cookie and then compare, the time in the cookie to the current time.
      >If 30 minutes elapses, then I will ... I dunno ... redirect to another
      >page I guess.
      >
      Unless you're proposing to redirect people off your site after half an
      hour of actively browsing it (and why not, I'm sure they'd come back),
      you've not thought this through.
      >
      Hmmm. I've worded it wrong...funny though. It's for answering
      questions. A user has 20 minutes to answer some questions, they either
      complete the questions, or if they are out of time, they are kicked to
      the final mark page.

      I've decided to place the current time in a php _SESSION variable and
      then just use Javascript to compare the time in the _SESSION to the
      current time. There is a problem through...

      Is it possible to read a php session variable from javascript? Maybe I
      should start a new thread. :-)

      Comment

      Working...