Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get session id? #33

Open
AmrinRajani92 opened this issue Mar 31, 2016 · 3 comments
Open

How to get session id? #33

AmrinRajani92 opened this issue Mar 31, 2016 · 3 comments

Comments

@AmrinRajani92
Copy link

Hi Team, in the docs about this wrapper class, I couldn't understand how to save the session id that is returned after login and re-use this session id for further API calls.

@tmarshall
Copy link
Contributor

@AmrinRajani92 the session Id is returned, for you to save it however you want, but you don't really need to. It keeps track of it, internally, and will pass it to any calls, as needed.

@CrackerakiUA
Copy link

@tmarshall in case we have many users with different session id, how can we pass those sessions via calls? for example list products.

@tmarshall
Copy link
Contributor

@CrackerakiUA I have not used this lib for a few years, so I'm rusty on it at this point. I've mentioned in another issue that it is no longer maintained by MadisonReed, and somebody should probably fork it or request ownership transfer. I am not with the company anymore and do not have write privileges.

Regarding you question, all the session management in this lib is contained in magento.js. It is set in .login and can be altered via .changeSession.

.login takes in a username and password, which assumes it is the credentials of a superuser, not an individual user. That's how the company was using Magento. Not on an individual user-by-user basis. You would have to fork the repo and change it to adhere to that logic if you want that. Or, you can make a new MagentoAPI for each user, as well. That may work. Similar to how it's displayed in the usage portion of the docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants