RPGLE web, PutCookie subprocedure

Posted on 2012-09-17
Last Modified: 2013-01-09
Using rpg, I need the ability to delete a cookie by setting the date in the past.

How would you rewrite the putcookie subprocedure in the attached file to accept an actual date, e.g. "Thu, 01-Jan-1970 00:00:01 GMT",  instead of the NumDays variable?

 Maybe adding another parameter for deleting the cookie would be a better idea.
Question by:roosterup
    LVL 34

    Expert Comment

    by:Gary Patterson
    What attached file?
    LVL 1

    Author Comment

    LVL 1

    Author Comment

    There we are.
    LVL 34

    Accepted Solution

    Change this line:

    if        (%parms > 2) and (NumDays > 0)

    to this:

    if        (%parms > 2) and (NumDays <> 0)

    And then you can pass a negative number of days to get a date in the past, which will cause the browser to delete the cookie.

    - Gary
    LVL 1

    Author Comment

    Right after I asked the question, I realized I could just pass a negative number to the original question.

    What would better suit my needs is the ability to set the experation date by minutes or hours and not be limited by full days.  Maybe change this:

    C     TimeStamp     AddDur    NumDays:*D    ExpDate

    to this:

    C     TimeStamp     AddDur    NumMin:*M    ExpDate

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Initial embeded SQL runs slow 7 515
    Compile Issue with Cusor Loction Solution 3 127
    ED710 -->  UADDMBX 10 192
    best way to update esxi hosts 6 85
    Digital marketing agencies have encountered both the opportunities and difficulties that emerge from working with a wide-ranging organizations.
    DECT technology has become a popular standard for wireless voice communication. DECT devices are not likely to be affected by other electronic devices and signals because they operate in a separate frequency-band.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now