Loading
Uniconta
Search
Generic filters
Free trial signup
  • Visit a Country Site
    • Dansk
    • Uniconta GermanyDeutsch
    • Eesti
    • Uniconta GermanyÍslenska
    • Lietuvis
    • Uniconta NetherlandsNederlands
    • Norsk
    • English
  • Search
  • Uniconta
    • What is Uniconta ?
    • Modules
    • Ledger
    • Customer
    • Sales Order
    • Vendor
    • Purchase
    • Inventory
    • Logistics
    • Project
    • Light Manufacturing
    • CRM
    • Fixed assets
    • Dashboard
    • Company
    • Adaptability
    • Uniconta Assistant App
    • Uniconta Upload App
  • Download
    • Uniconta for Windows
    • Uniconta for Mac
    • Download for Developers
    • Free trial signup
  • Resellers
    • Find a reseller
    • Become a reseller
    • Uniconta Partner info Login
    • Uniconta Partner info Sign up
  • Developers
    • Become an integration partner
    • Documentation
    • Samples
    • Downloads
  • Accountants
    • Become a Univisor
  • News Overview
    • Blog
    • News
    • Uniconta Update
    • Customer cases
  • About us
    • About us
      • Management
      • Contact
      • IT Security ISAE 3402
      • System status
    • Terms & Conditions
      • License Agreement
      • Data Processing Agreement (DPA)
      • Privacy policy
      • Cookie policy
      • Sub-processors

Developers Unipedia

  • API
    • API
    • User defined fields
    • User defined tables
    • Saving a Session
    • Posting an Invoice
    • Post Invoice and get PDF
    • Localization
    • Attach physical voucher to entities
    • Server-Login User
    • How to find C# Property from Uniconta Label
    • Minimize network traffic and optimize speed
  • Plugins
    • Plugins
    • Debug Uniconta Plugins
    • Refreshing UI with plugins
    • How to use Uniconta Plugin
    • Develop a user plugin
    • Event Handling
    • Global Script
    • How to capture menu events
    • How to open a form in Uniconta from Plugin
    • Open new content in a IContentPluginBase plugin
    • Adding plugin in a menu
    • How to add user parameter in plugin menu
    • How to create plugin with Devexpress Library
    • Synchronize Entity Support in form page
    • Develop a PageEventBase Plugin
    • Logging Exceptions on local machine
    • Create Custom Uniconta Pages From Github Code
    • Web frame integration
  • OData
    • CRUD operations in OData
    • ODATA REST API – Testing with Postman

Saving a Session

1,255 November 27th, 2018 January 7th, 2021 < 1 minute
Print Friendly, PDF & Email

You can save a Session in Uniconta. You might want to do this, if you wish to keep a user’s Session, so they do not have to log in again.

In the code beneath, two methods are showed, SaveSession and GetSession.

SaveSession simply saves a Session at a given path as a byte[].

GetSession returns a Session based on a byte[].

If the saved session was logged in, GetSession will return a logged in Session.

public void SaveSession(Session session, string path)
{
    var bytes = session.ToArray();
    File.WriteAllBytes(path, bytes);
}
public Session GetSession(string path, UnicontaConnection connection)
{
    var bytes = File.ReadAllBytes(path);
    var session = new Session(connection);
    session.FromArray(bytes);
    return session;
}

 

Categories: API, Developers Unipedia, Plugins
Home » Developers Unipedia » API » Saving a Session

Get in touch with us

Uniconta

  • Uniconta
  • Modules
  • Downloads
  • Free trial signup
  • Subscription Terms
  • System Status

PARTNER

  • Become a Reseller
  • Uniconta API key application
  • For Developers
  • For Accountants (Univisor)
  • Uniconta Partner info

INFO

  • News
  • Updates
  • Customer cases
  • Video
  • IT Security
  • About us
  • Management

Support

  • Unipedia
  • API information
  • Contacts
  • Visit a Country Site
    • Dansk
    • Uniconta GermanyDeutsch
    • Eesti
    • Uniconta GermanyÍslenska
    • Lietuvis
    • Uniconta NetherlandsNederlands
    • Norsk
    • English
Uniconta
© Copyright 2019 | All rights reserved | [email protected] | Terms & Conditions
Facebook LinkedIn Youtube