• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

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.
0
roosterup
Asked:
roosterup
  • 3
  • 2
1 Solution
 
Gary PattersonVP Technology / Senior Consultant Commented:
What attached file?
0
 
roosterupAuthor Commented:
oops
COOKIE.TXT
0
 
roosterupAuthor Commented:
There we are.
0
 
Gary PattersonVP 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
0
 
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
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now