RPGLE web, PutCookie subprocedure

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.
Who is Participating?
Gary PattersonConnect With a Mentor VP Technology / Senior Consultant Commented:
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
Gary PattersonVP Technology / Senior Consultant Commented:
What attached file?
roosterupAuthor Commented:
roosterupAuthor Commented:
There we are.
roosterupAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.