Giter Club home page Giter Club logo

Comments (6)

TatankaConCube avatar TatankaConCube commented on July 20, 2024

@wrteam-priyansh first of all, sorry for a longtime answer. It happens because we don't save session data to storage only to variables and they clean by the system after the app destroy. You have the right logic for session managing, but your code can be simplified by using callback restoreSession which will be called if our SDK needs a session with a user. More by link.

from connectycube-flutter-samples.

wrteam-priyansh avatar wrteam-priyansh commented on July 20, 2024

@TatankaConCube Thanks for replying , i have used this code in order to restore session...
onSessionRestore: () async {
if (Constant.session.getBoolData(UserSessionManager.IS_USER_LOGIN)) {
print("User is logged in");
CubeUser cubeUser = CubeUser(
id: Constant.session
.getIntData(UserSessionManager.KEY_CONNECTYCUBE_ID),
email: Constant.session.getData(UserSessionManager.KEY_EMAIL),
login: Constant.session
.getData(UserSessionManager.KEY_CONNECTYCUBE_LOGIN),
password: Constant.ConnectyCube_DEFAULT_PASS);

    return createSession(cubeUser);
  } else {
    print("User is logged not in");
  }
  return null;
}

but still i have to follow the login process after closing the app.
Can you please tell me what is wrong in above mention code

from connectycube-flutter-samples.

TatankaConCube avatar TatankaConCube commented on July 20, 2024

It is expected behavior when we create a new session after app closing. If you don't want to recreate the session after app closing, you can save the active session in storage then after app opening set it as an active session via:

CubeSession savedSession; // get saved session
CubeSessionManager.instance.activeSession = savedSession;

from connectycube-flutter-samples.

wrteam-priyansh avatar wrteam-priyansh commented on July 20, 2024

@TatankaConCube Thanks for replying. will try this soon

from connectycube-flutter-samples.

wrteam-priyansh avatar wrteam-priyansh commented on July 20, 2024

@TatankaConCube do we have to follow login process every time opens application?

from connectycube-flutter-samples.

TatankaConCube avatar TatankaConCube commented on July 20, 2024

It is required if you use API calls. It needs to provide an additional security level for your app.

from connectycube-flutter-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.