<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Session problem with webscreenlet for iOS</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=110643716" />
  <subtitle>Session problem with webscreenlet for iOS</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=110643716</id>
  <updated>2026-04-05T01:18:52Z</updated>
  <dc:date>2026-04-05T01:18:52Z</dc:date>
  <entry>
    <title>RE: Session problem with webscreenlet for iOS</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110651847" />
    <author>
      <name>Victor Galan</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110651847</id>
    <updated>2018-07-31T16:57:18Z</updated>
    <published>2018-07-31T16:57:18Z</published>
    <summary type="html">&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;self.url is an absolute URL? It should be a relative URL if you want
  to use that method. do you have the screenlet delegate set? are you
  receiving any error on it?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Victor Galan</dc:creator>
    <dc:date>2018-07-31T16:57:18Z</dc:date>
  </entry>
  <entry>
    <title>Session problem with webscreenlet for iOS</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110643715" />
    <author>
      <name>Beatriz Valdés Suárez</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110643715</id>
    <updated>2018-07-26T13:03:12Z</updated>
    <published>2018-07-26T13:03:12Z</published>
    <summary type="html">&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;We’re trying to go to a relative url using a webscreenlet  component 
  (Liferay 6.2)  for iOS using the native liferay sdk.&lt;/p&gt;
&lt;p&gt;For redirecting user to this url, we’re previously checking the
  session validity, so the user is logged in.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;SessionContext.loadStoredCredentials()&lt;/p&gt;
&lt;p&gt;if(SessionContext.isLoggedIn) {&lt;/p&gt;
&lt;p&gt;……&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;When the webscreenlet loads the url, the method
  self.webSreenlet?.load() inserts the user, password and webUrl in the
  html string correctly.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;let webScreenletConfiguration = WebScreenletConfigurationBuilder(url: self.url).load()&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;webScreenlet?.configuration = webScreenletConfiguration&lt;/p&gt;
&lt;p&gt;webScreenlet?.loggingEnabled = true&lt;/p&gt;
&lt;p&gt;self.webScreenlet?.load(&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;This is the HTML string loaded by the webscreenlet&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&amp;quot;&amp;lt;html&amp;gt;\n\n&amp;lt;head&amp;gt;\n\t&amp;lt;script&amp;gt;\n\t\tfunction
  post() {\n\t\t\tvar method = \'post\';\n\t\t\tvar form =
  document.createElement(\'form\');\n\t\t\tform.setAttribute(\'method\',
  method);\n\t\t\tform.setAttribute(\'action\',
  \'/c/portal/login?redirect=XXXXX');\n\n\t\t\tvar params =
  {\n\t\t\t\tlogin: \’XXXX\',\n\t\t\t\tpassword:
  \’XXXX\',\n\t\t\t\trememberMe: true\n\t\t\t};\n\n\t\t\tfor (var key in
  params) {\n\t\t\t\tif (params.hasOwnProperty(key)) {\n\t\t\t\t\tvar
  hiddenField =
  document.createElement(\'input\');\n\t\t\t\t\thiddenField.setAttribute(\'type\',
  \'hidden\');\n\t\t\t\t\thiddenField.setAttribute(\'name\',
  key);\n\t\t\t\t\thiddenField.setAttribute(\'value\',
  params[key]);\n\n\t\t\t\t\tform.appendChild(hiddenField);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdocument.body.appendChild(form);\n\t\t\tform.submit();\n\t\t}\n\t&amp;lt;/script&amp;gt;\n&amp;lt;/head&amp;gt;\n\n&amp;lt;body onload=post()&amp;gt;\n&amp;lt;/body&amp;gt;\n\n&amp;lt;/html&amp;gt;\n&amp;quot;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;My issue is that the URL is not the one that I want, but the initial
  one where the user must log in.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;If I try to load again the same URL using the same method, this time
  the page is loaded and shown.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;My question is, why the first time the URL is not loaded, as if the
  user were not logged in?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Many thanks in advance!&lt;/p&gt;</summary>
    <dc:creator>Beatriz Valdés Suárez</dc:creator>
    <dc:date>2018-07-26T13:03:12Z</dc:date>
  </entry>
</feed>
