<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Difference between logontoken and serializedsession? in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757177#M217799</link>
    <description>&lt;P&gt;I've used the token for similar usage-cases.&lt;/P&gt;&lt;P&gt;But I started to wonder if a serialized session might be more efficient.  Can the .Net client assembly create the EnterpriseSession instance w/o a trip to the server?  Does the LogonWithToken require a trip to the server?  Which is faster?  I'll trade a little more memory usage in my web or powershell app for faster transactions.&lt;/P&gt;&lt;P&gt;Also, it's great having a discussion w/ someone with similar experiences.  +1&lt;/P&gt;</description>
    <pubDate>Wed, 27 Feb 2019 23:05:03 GMT</pubDate>
    <dc:creator>first_last</dc:creator>
    <dc:date>2019-02-27T23:05:03Z</dc:date>
    <item>
      <title>Difference between logontoken and serializedsession?</title>
      <link>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaq-p/757175</link>
      <description>&lt;P&gt;What is the conceptual difference between a &lt;EM&gt;logontoken&lt;/EM&gt; and a &lt;EM&gt;serializedsession&lt;/EM&gt;? Should I prefer one over the other?&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;ISessionMgr sessionMgr = CrystalEnterprise.GetSessionMgr();
IEnterpriseSession enterpriseSession = sessionMgr.Logon([userName], [password], [cmsName], [authentication]);

// create token
string token = enterpriseSession.LogonTokenMgr.DefaultToken
...
// use token to recreate new EnterpriseSession
IEnterpriseSession enterpriseSession = sessionMgr.LogonWithToken(token);

// create serialized session
string serializedSession = enterpriseSession.SerializedSession;

// use token to recreate new EnterpriseSession
IEnterpriseSession enterpriseSession = sessionMgr.getSession(serializedSession);
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Does the &lt;EM&gt;LogonWithToken&lt;/EM&gt; method hit the repository where the &lt;EM&gt;getSession&lt;/EM&gt; method does not? Is one smaller (fewer bytes) than the other? Is one faster?&lt;/P&gt;
  &lt;P&gt;PS: is there a way to mark code inline, rather than using &lt;EM&gt;italics&lt;/EM&gt; as I've done?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 19:52:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaq-p/757175</guid>
      <dc:creator>first_last</dc:creator>
      <dc:date>2019-02-27T19:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between logontoken and serializedsession?</title>
      <link>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757176#M217798</link>
      <description>&lt;P&gt;When you log on with a token, you can set the number of logons and the amount of time a token a valid for.  A serialized session is just a serialized version of the session - it is only good for the current logon and for the default amount of inactive time.&lt;/P&gt;&lt;P&gt;I have used tokens in a number of situations, most recently with a web site that had a micro services back end.  Within the application, a user could access multiple reports during a session.  For each report, there could potentially be multiple service calls - for example, one to get the parameters that are valid in the report, and another to get the full OpenDocument URL for the report, including the user selected parameter values. The token gets passed back to the service with every call and with many of the calls, the user is logged off just before the info is sent back to the GUI.  This helps prevent memory issues in the back end because it doesn't have various serialized sessions sitting around in its processes.  With the token, I can log the user back in with the same token without having to get another session.  This way the token is tracked and stored in the front end as well.&lt;/P&gt;&lt;P&gt;-Dell&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 22:16:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757176#M217798</guid>
      <dc:creator>DellSC</dc:creator>
      <dc:date>2019-02-27T22:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between logontoken and serializedsession?</title>
      <link>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757177#M217799</link>
      <description>&lt;P&gt;I've used the token for similar usage-cases.&lt;/P&gt;&lt;P&gt;But I started to wonder if a serialized session might be more efficient.  Can the .Net client assembly create the EnterpriseSession instance w/o a trip to the server?  Does the LogonWithToken require a trip to the server?  Which is faster?  I'll trade a little more memory usage in my web or powershell app for faster transactions.&lt;/P&gt;&lt;P&gt;Also, it's great having a discussion w/ someone with similar experiences.  +1&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 23:05:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757177#M217799</guid>
      <dc:creator>first_last</dc:creator>
      <dc:date>2019-02-27T23:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between logontoken and serializedsession?</title>
      <link>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757178#M217800</link>
      <description>&lt;P&gt;Thinking about this a little more, one of the reasons I use the token is because the code for logging in is in the back-end, but the token is stored in the front end.  In this case, if you create a new session for the next user, how do you know whether it has overwritten the one that was created by the SessionManager for the previous user?  Because the back end is not in the context as the front end when the back end is a service, I think you might have issues with the session timing out.  Of course, I may be wrong - I mostly write back end utilities where this is not an issue and I sometimes have a hard time grokking the flow of what's valid where in a web application.&lt;/P&gt;&lt;P&gt;-Dell&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 23:18:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757178#M217800</guid>
      <dc:creator>DellSC</dc:creator>
      <dc:date>2019-02-27T23:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between logontoken and serializedsession?</title>
      <link>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757179#M217801</link>
      <description>&lt;P&gt;One of the major differences is the open session behavior:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;with a token: this will open another user session for the user&lt;/LI&gt;&lt;LI&gt;with serialized session: this will work in the same user session, no additional session is opened&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 28 Feb 2019 05:47:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757179#M217801</guid>
      <dc:creator>TJe</dc:creator>
      <dc:date>2019-02-28T05:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between logontoken and serializedsession?</title>
      <link>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757180#M217802</link>
      <description>&lt;P&gt;If it opens a new session, does it automatically close the other?  Does this tend to consume concurrent licenses?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 13:36:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757180#M217802</guid>
      <dc:creator>first_last</dc:creator>
      <dc:date>2019-02-28T13:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between logontoken and serializedsession?</title>
      <link>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757181#M217803</link>
      <description>&lt;P&gt;As it is the same user, would assume it doesn't consume another concurrent license.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 13:47:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757181#M217803</guid>
      <dc:creator>TJe</dc:creator>
      <dc:date>2019-02-28T13:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between logontoken and serializedsession?</title>
      <link>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757182#M217804</link>
      <description>&lt;P&gt;Logon is an expensive operation from a performance standpoint, so tokens that are shared with existing sessions are faster.&lt;/P&gt;&lt;P&gt;CreateLogonToken(numUses, numMinutes)&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;This will create a token valid for the specified number of logons or expires after numMinutes, whichever comes first.  It consumes a license whenever used, so an existing session can be logged off and the token can be used to start up the session again&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CreateWCAToken()&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The WCAToken can be used and shared without consuming additional licenses.  Once the session that created the token expires or is logged off, the token is invalidated and cannot be used elsewhere (ie opendoucment calls)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SerializedSession() &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;the serializedsession behaves the same as a WCAToken.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 22:14:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757182#M217804</guid>
      <dc:creator>daniel_paulsen</dc:creator>
      <dc:date>2019-03-06T22:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between logontoken and serializedsession?</title>
      <link>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757183#M217805</link>
      <description>&lt;P&gt;Which type of token mechanism is used internally by the RESTful SDKs /logon/long method?&lt;/P&gt;&lt;P&gt;If I wanted to create a RESTful application that passes a token in the HTTP headers, like what the RESTful SDK is doing, which token mechanism would you suggest?  Currently, I'm using the DefaultToken.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 21:46:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757183#M217805</guid>
      <dc:creator>first_last</dc:creator>
      <dc:date>2019-03-08T21:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between logontoken and serializedsession?</title>
      <link>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757184#M217806</link>
      <description>&lt;P&gt;If you want to use restful, then you must log on and create an X-SAP-LogonToken.&lt;/P&gt;&lt;P&gt;you can log on using &lt;/P&gt;&lt;OL&gt;&lt;LI&gt;/logon/long  (username and password)&lt;/LI&gt;&lt;LI&gt;/logon/token (token or serialized session created from Java or .Net SDK)&lt;/LI&gt;&lt;LI&gt;/logon/trusted  (trusted authentication)&lt;/LI&gt;&lt;LI&gt;/logon/adsso  (single sign-on)&lt;/LI&gt;&lt;LI&gt;/logon/saml/saml&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;With an X-SAP-LogonToken, regardless of how it was created, it is terminated when the originating session is logged off or timed out, but an additional license is not used if created from an existing session (/logon/trusted).   In this aspect, it behaves like a WCAToken.  If you use this token outside of RESTful, (ie openDocument)  then it will consume a license, which is like a default token.&lt;/P&gt;&lt;P&gt;So in answer to your question, a RESTful token is sort of a combination of &lt;EM&gt;default&lt;/EM&gt; and &lt;EM&gt;wca &lt;/EM&gt;tokens.  You will need to consider how you will be using restful and what will or can happen to the originating session when going from one SDK to another.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 22:32:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757184#M217806</guid>
      <dc:creator>daniel_paulsen</dc:creator>
      <dc:date>2019-03-08T22:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between logontoken and serializedsession?</title>
      <link>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757185#M217807</link>
      <description>&lt;P&gt;I'm using token or serialized session in my code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;public static enum TOKEN_TYPE {
	token, serializedSession
}

private void logon(String sessionToken, TOKEN_TYPE tokenType) throws Exception {
// Sends the logon request
Request request = new Request();
request.send(getBIP_RWS() + "/logon/token", "GET", null, false);
if (tokenType == TOKEN_TYPE.serializedSession) sessionToken = StringEscapeUtils.escapeXml(sessionToken);

// Sets logon information
Map&amp;lt;String, String&amp;gt; map = new HashMap&amp;lt;String, String&amp;gt;();
map.put("//attr[@name='tokenType']", tokenType.toString());
map.put("//attr[@name='logonToken']", sessionToken);

String filledLogonResponse = request.getResponseContent().replaceFirst("&amp;lt;attr name=\"logonToken\" type=\"string\"&amp;gt;&amp;lt;/attr&amp;gt;", "&amp;lt;attr name=\"logonToken\" type=\"string\"&amp;gt;" + sessionToken + "&amp;lt;/attr&amp;gt;");

// must specify the correct token type
filledLogonResponse = filledLogonResponse.replaceFirst("&amp;gt;token&amp;lt;/attr&amp;gt;", "&amp;gt;" + tokenType.toString() + "&amp;lt;/attr&amp;gt;");

// Posts logon information
request.send(getBIP_RWS() + "/logon/token", "POST", filledLogonResponse, false);
logonToken = request.getResponseHeaders().get("X-SAP-LogonToken").get(0);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Mar 2019 08:44:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/difference-between-logontoken-and-serializedsession/qaa-p/757185#M217807</guid>
      <dc:creator>TJe</dc:creator>
      <dc:date>2019-03-09T08:44:45Z</dc:date>
    </item>
  </channel>
</rss>

