These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

How do I display the name of the character after logging in? (EVE SSO)

First post
Author
Marquis de Aurilen
Caldari Provisions
Caldari State
#1 - 2014-12-27 23:01:45 UTC  |  Edited by: Marquis de Aurilen
Hello! I'm using fuzzysteve's SSO auth and I finally got it to work. I have a database with the names of the characters, how would I use that to display the names instead of the login button? Also, how would I make the session last indefinitely? Thanks!
Marquis de Aurilen
Caldari Provisions
Caldari State
#2 - 2014-12-27 23:23:58 UTC  |  Edited by: Marquis de Aurilen
(deleted)
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#3 - 2014-12-28 03:54:03 UTC
My SSO code dumps details into the users session.

so if you want the get their character name, once they're logged in, you'll find it in $_SESSION['auth_charactername']

If you want to check to see if someone's logged in, check to see if $_SESSION['auth_charactername'] or $_SESSION['auth_characterid'] is set. So wrap your login button display in an if statement which checks it.


< ?php
if (isset($_SESSION['auth_characterid'])) {
echo $_SESSION['auth_charactername'];
} else {
# display login button
}
?>


As for making the session last indefinitely, you'd need to push the various auth_ session variable into something stored server side, and set an additional cookie on the client. Then have your code check to see if the session has them filled in, and if not, rehydrate it from the server side core, depending on that cookie.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter