Questions Tagged With sessionhttps://answers.axonivy.com/tags/session/?type=rss&user=Genzer%20Hawkerquestions tagged <span class="tag">session</span>enFri, 27 May 2016 07:54:55 -0400Is there any possible way to switch SYSTEM session to another regular user's session in a ProgramStart execution?https://answers.axonivy.com/questions/1780/is-there-any-possible-way-to-switch-system-session-to-another-regular-user-s-session-in-a-programstart-execution<p>In our project, we use <code>ProgramStart</code> to implement <code>cron</code> jobs. The executions will always be carried on by the SYSTEM user using only one <code>ISession(id = 0)</code>.</p> <p>The problem is, we heavily store plenty of <em>Context Information</em> (authentication token, user-session-specific data, etc) into <code>ISession.setAttribute()</code>. It works well on normal situation with logged-in Ivy user. However, because in background jobs, there is only one session, each execution will interfere with each others, trying to <code>set</code> and <code>get</code> the <em>Context Information</em>.</p> <p>In addition, this happens the same with <code>Signals</code> since execution of those also delegated to <code>SYSTEM</code>.</p> <p>I've tried to call <code>ivy.session.login()</code> but it threw exception since Axon.ivy refuse to allow logging out of <code>SYSTEM</code> user.</p> <p>My question is: Is there any possible way to switch from SYSTEM sessions to regular normal user's session?</p> <p>Thanks</p>Genzer HawkerFri, 27 May 2016 07:54:55 -0400https://answers.axonivy.com/questions/1780/is-there-any-possible-way-to-switch-system-session-to-another-regular-user-s-session-in-a-programstart-executionbackground-jobsignalssessionsystemTemporary (Ivy) file created by System session will not be deletedhttps://answers.axonivy.com/questions/1121/temporary-ivy-file-created-by-system-session-will-not-be-deleted<p>In the documentation of Ivy <a href="http://developer.axonivy.com/doc/latest/DesignerGuideHtml/ivy.ivyscript.html#ivy.ivyscript.reference.datatypes">File</a> (emphasis mine)</p> <blockquote> <p>A File object can be used to read/write temporary or persistent data. IvyScript Files are created in a confined area that belongs to the running application. Temporary files are created in a session-specific file area and <strong>are automatically deleted if a session ends</strong>. Temporary Files can be made persistent.</p> </blockquote> <p>If a <em>temporary</em> <code>File</code> is created, it will be located at <code>{app}/files/sessions/{sessionId}/</code>. The files then will be deleted if the session is invalidated.</p> <p>Unfortunately, this isn't true for <em>temporary</em> files created by SYSTEM user. The SYSTEM user's session is always have the <code>id</code> of <code>0</code>, hence all files created in SYSTEM user's session will be located at <code>{app}/files/sessions/0/</code>.</p> <p>It seems that Ivy Server will never invalidate SYSTEM user's session, thus all files located in the directory will by left there undeleted (same as <em>persistent</em> file).</p> <p>I don't know whether this is a known fact as a consequence of the implementation that SYSTEM user will never be invalidated or it should be considered (somehow) as a bug?</p> <p>Thanks for considering my question.</p> <p>Regards</p>Genzer HawkerFri, 16 Jan 2015 09:24:48 -0500https://answers.axonivy.com/questions/1121/temporary-ivy-file-created-by-system-session-will-not-be-deletedsessiontemporaryfile