1

Is there any way to retrieve session id so other programs could share it for the login? Or is it allowed to share session id among multiple programs for a single user?

Thanks.

mile
  • 362
  • 1
  • 5
  • 15

1 Answers1

2

No, this isn't allowed. You're allowed to have the user separately log into each app, but you can't share login details between processes like that.

Also, there's no "session id" for libSpotify to expose — this isn't an OAuth app!

iKenndac
  • 18,537
  • 3
  • 32
  • 50
  • I should clarify it - what I meant "multiple programs" was "multiple modules". I'm thinking to have one application with multiple modules, with one module to play track and the others to browse metadata, but I'm not sure which way is more feasible - either to login once for all the modules to run parallely or login once for each individual module. – mile Jun 04 '12 at 19:25
  • I'm not sure what language you're in, but if it's in the same process space you can use the same sp_session instance just fine. In fact, if that's the case you *can't* make more than one sp_session - the session is stored internally as a global variable. – iKenndac Jun 04 '12 at 20:33
  • What about multi-processes application that are either called by a server (browsing) or run in the background (playing)? Do I need multiple login? I'm using C and plan to use the program in an embedded device. – mile Jun 04 '12 at 21:16
  • We'd typically advise using one process for libSpotify - it can be very resource-intensive at times, and having that twice isn't ideal. – iKenndac Jun 05 '12 at 08:38
  • Also, two running instance of libSpotify can't share the same cache, which is pretty bad for performance too. – iKenndac Jun 05 '12 at 08:39
  • That's too bad... I have a program sending out commands like browse tracks and search artists etc. My plan is to update **spshell** example to receive these commands and print out results. It will be too much to login for each command. Any suggestions? Thanks. – mile Jun 06 '12 at 13:54
  • Yes — have only one application instance that handles all the commands. – iKenndac Jun 08 '12 at 01:21