ymkjp / opensocial-php-client

Automatically exported from code.google.com/p/opensocial-php-client
Apache License 2.0
0 stars 0 forks source link

What when you use the OAuth for userlogin on your site? #69

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When i use the OAuth as userlogin system.
I use the sessionid to start, when the user is logged in, i update the
storage cache to the new localuserid (in stead of the sessionid), this
because sessionid's can reset unexpected.
i have manually added this.. but i guess i could be a feature..
like updateLocalUserId and it updates automatically the cache?

example in my osapi extended class:
function updateStorage($localUserId){
        $newstorageKey = 'OAuth:' . NETLOG_CONSUMER_KEY . ':' . null . ':' .
$localUserId;
        if ($this->storageKey != $newstorageKey){
            if (($token = $this->storage->get($this->storageKey)) !== false) {
                $this->storage->set($newstorageKey, $token);
            }
        }
    }

i keep the old cache so i wouldn't have to reset all my vars.
and it will work next pagecall with the new cache.

Original issue reported on code.google.com by maescool on 2 Dec 2009 at 12:58