Hi All,
Has anyone had issues with sessions expiring after downloading a document from an iSeries using VL Web?
We're using VL150040, iSeries V7R5M0 and our routine looks something like this (we have others similar):
Srvroutine Name(GetPDFFile) Response(*RESOURCE #Response)
Field_Map For(*INPUT) Field(#pdfGenPath) Parameter_Name(pdfPath)
Field_Map For(*INPUT) Field(#pdfName) Parameter_Name(pdfName)
Field_Map For(*INPUT) Field(#UserWebID) Parameter_Name(User)
#Response.ContentFile := #pdfGenPath.trim + #pdfName.Trim
#Response.AttachmentFileName := #pdfName.Trim
#Response.ContentType := "application/pdf"
Endroutine
After running this code, when we try to reach other parts of the application, our session has "expired"!
Anyone experienced something like this?
iSeries VL Web Session expiring after downloading file
-
cesarrafael
- Posts: 32
- Joined: Tue Dec 01, 2015 3:44 am
-
René Houba
- Posts: 220
- Joined: Thu Nov 26, 2015 7:03 am
Re: iSeries VL Web Session expiring after downloading file
Hi Cesar,
What if you add the Session(*REQUIRED) parameter to the svrroutine?
Kind regards,
René
What if you add the Session(*REQUIRED) parameter to the svrroutine?
Kind regards,
René
-
cesarrafael
- Posts: 32
- Joined: Tue Dec 01, 2015 3:44 am
Re: iSeries VL Web Session expiring after downloading file
Nope....Still get a session expired after downloading the file....it's very strange...something is causing the session to expire or, maybe, starting a new Lweb_job and causing the session to be invalid...
Re: iSeries VL Web Session expiring after downloading file
Hi Cesar,
What does the call to the server routine look like on the client?
I believe you are getting this behaviour because the target for the download is specified as current. Try specifying the target as new before you call the server module execute. I also recommend keeping session required on this server routine so it cannot be called without a valid session.
For example:
Mthroutine Name(DownloadDocument)
Define_Com Class(#DocumentDataServer.GetPDFFile) Name(#GetPDFFile)
#GetPDFFile.Target := New
#GetPDFFile.Execute
Endroutine
What does the call to the server routine look like on the client?
I believe you are getting this behaviour because the target for the download is specified as current. Try specifying the target as new before you call the server module execute. I also recommend keeping session required on this server routine so it cannot be called without a valid session.
For example:
Mthroutine Name(DownloadDocument)
Define_Com Class(#DocumentDataServer.GetPDFFile) Name(#GetPDFFile)
#GetPDFFile.Target := New
#GetPDFFile.Execute
Endroutine
-
cesarrafael
- Posts: 32
- Joined: Tue Dec 01, 2015 3:44 am
Re: iSeries VL Web Session expiring after downloading file
Hi Jimmy,
Many thanks! That worked perfectly!
I wonder why that happens....We're using the Target(Current) on other different pages with no problem at all!
Anyway, that was very helpfull.
Cheers,
Many thanks! That worked perfectly!
I wonder why that happens....We're using the Target(Current) on other different pages with no problem at all!
Anyway, that was very helpfull.
Cheers,