jdolitsky / AppDotNetPHP

PHP library for the App.net Stream API
34 stars 19 forks source link

Cookies, Sessions ... #10

Closed ghost closed 11 years ago

ghost commented 11 years ago

Hey guys,

I know there have been some exchanges on this but what can we do to implement solid cookie session setting support into the library directly? Before I go off and try to hack something together maybe better expertise can do it and help make it standard for apps using this lib.

Cheers,

Harold

ravisorg commented 11 years ago

I would consider that to be an implementation thing, not something that should be handled by the library (feel free to argue this tho, I might be wrong).

Either way check out remember_me.php for an example of what you want to do, it's actually pretty easy (2 lines of code!) :)

jdolitsky commented 11 years ago

I've just made a bunch of changes to the library. First, I've made it so you can construct again using $app = new AppDotNet(); if you have set your values in settings.php.

Otherwise you must provide clientid, secret, url, AND scope. Check the new Readme file. @ravisorg I have removed your remember_me.php file and added this functionality directly into the setSession function. if you call: $token = $app->setSession(1);

if will save a cookie in addition to a session. check the new callback.php to see what I mean.

Lastly try loading the new index.php page. @hxf148 You should now be able to have a working example of a remember me checkbox for sign in. though I would maybe use AJAX instead in production

Let me know your thoughts on all this,

Josh

ghost commented 11 years ago

Very cool.

I did put my own cookie auth together quickly but this sounds better.

I'll probably not implement until later today/tonight EDT.

Thanks for your work!

Harold http://hxf148.com

On Tue, Aug 21, 2012 at 1:51 PM, Josh Dolitsky notifications@github.comwrote:

I've just made a bunch of changes to the library. First, I've made it so you can construct again using

$app = new AppDotNet();

if you have set your values in settings.php. Otherwise you must provide clientid, secret, url, AND scope. Check the new Readme file. @ravisorghttps://github.com/ravisorgI have removed your remember_me.php file and added this functionality directly into the setSession function. if you call:

$token = $app->setSession(1);

if will save a cookie in addition to a session. check the new callback.php to see what I mean.

Lastly try loading the new index.php page. @hxf148https://github.com/hxf148You should now be able to have a working example of a remember me checkbox for sign in. though I would maybe use AJAX instead in production

Let me know your thoughts on all this,

Josh

— Reply to this email directly or view it on GitHubhttps://github.com/jdolitsky/AppDotNetPHP/issues/10#issuecomment-7909749.