Re: [android-developers] preserve session

2011-06-07 Thread Daniel Drozdzewski
On Tue, Jun 7, 2011 at 1:17 PM, Knutsford Software
 wrote:
>
> - Original Message - From: "Daniel Drozdzewski"
> 
> To: 
> Sent: Tuesday, June 07, 2011 10:58 AM
> Subject: Re: [android-developers] preserve session
>
>
>> GET or POST does not matter.
>>
>> Does your server create any sessions?
>> Does your client know to accept cookies?
>>
>> You have to read up on http sessions.
>>
>> Daniel
>>
>>
>
>
>
> Err how do you do it if you want to display the index.php page for browsing?
> You don't post
>
>
> Pam

Pam,

it's true that your will more likely hit login.php using GET, but it
does not stop me using POST.
>From http session point of view GET or POST does not matter.

What matters is that the server need to create new session and inform
the client about the session ID (using cookies or URL rewrites or
hidden input fields or whatever else).

The client has to inform the server in each subsequent request that it
has session ID (through cookies or rewritten by the server URLs or
whatever else) in order to participate in session.

Server has to recognise clients passing session ID to it.

You therefore must ensure that both client and server know what to do
and when to do it.
Things like cookie driven sessions will come out of the box in php and
http client, but have to be set-up and certain logic must be there to
accommodate various scenarios and exceptions.

have a look at wikipedia as a starting point:
http://en.wikipedia.org/wiki/Session_(computer_science)

Daniel

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] preserve session

2011-06-07 Thread Knutsford Software


- Original Message - 
From: "Daniel Drozdzewski" 

To: 
Sent: Tuesday, June 07, 2011 10:58 AM
Subject: Re: [android-developers] preserve session



GET or POST does not matter.

Does your server create any sessions?
Does your client know to accept cookies?

You have to read up on http sessions.

Daniel






Err how do you do it if you want to display the index.php page for browsing? 
You don't post



Pam 


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] preserve session

2011-06-07 Thread Daniel Drozdzewski
GET or POST does not matter.

Does your server create any sessions?
Does your client know to accept cookies?

You have to read up on http sessions.

Daniel




On Tue, Jun 7, 2011 at 10:13 AM, Knutsford Software
 wrote:
>
> - Original Message - From: "Daniel Drozdzewski"
> 
> To: 
> Sent: Tuesday, June 07, 2011 9:54 AM
> Subject: Re: [android-developers] preserve session
>
>
>> On Tue, Jun 7, 2011 at 9:42 AM, Knutsford Software
>>  wrote:
>>>
>>> How do you preseerve the php session between call a login page then
>>> calling
>>> the index.php page from an android app? I thought having just one
>>>
>>> DefaultHttpClient should work but it isn't
>>>
>>>
>>>
>>> Thanks
>>
>> It depends how sessions are being implemented.
>>
>> Most likely it is through Cookies and usually it is done by 'magic',
>> i.e. server creates the session and sends its ID through cookie back
>> to the client. Client as long as it is within the session, should pass
>> that cookie back to the server with each subsequent request.
>>
>> Server has to also be aware of sessions and retrieve the session ID
>> from each incoming request.
>>
>> --
>> Daniel Drozdzewski
>>
>
>
>
>
> 9I am using httppost for the login page but
>
>
>
>
>
>
>
> String urltemp = "http://www.blabla/index.php";;
>
> Intent i = new Intent(Intent.ACTION_VIEW);
>
> i.setData(Uri.parse(urltemp));
>
> startActivity(i);
>
>
>
> for the index page
>
>
>
> Should I change that to a post to get it to work?
>
>
>
>
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
Daniel Drozdzewski

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] preserve session

2011-06-07 Thread Knutsford Software


- Original Message - 
From: "Daniel Drozdzewski" 

To: 
Sent: Tuesday, June 07, 2011 9:54 AM
Subject: Re: [android-developers] preserve session



On Tue, Jun 7, 2011 at 9:42 AM, Knutsford Software
 wrote:
How do you preseerve the php session between call a login page then 
calling

the index.php page from an android app? I thought having just one

DefaultHttpClient should work but it isn't



Thanks


It depends how sessions are being implemented.

Most likely it is through Cookies and usually it is done by 'magic',
i.e. server creates the session and sends its ID through cookie back
to the client. Client as long as it is within the session, should pass
that cookie back to the server with each subsequent request.

Server has to also be aware of sessions and retrieve the session ID
from each incoming request.

--
Daniel Drozdzewski






9I am using httppost for the login page but







String urltemp = "http://www.blabla/index.php";;

Intent i = new Intent(Intent.ACTION_VIEW);

i.setData(Uri.parse(urltemp));

startActivity(i);



for the index page



Should I change that to a post to get it to work?





Thanks

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] preserve session

2011-06-07 Thread Daniel Drozdzewski
On Tue, Jun 7, 2011 at 9:42 AM, Knutsford Software
 wrote:
> How do you preseerve the php session between call a login page then calling
> the index.php page from an android app? I thought having just one
>
> DefaultHttpClient should work but it isn't
>
>
>
> Thanks

It depends how sessions are being implemented.

Most likely it is through Cookies and usually it is done by 'magic',
i.e. server creates the session and sends its ID through cookie back
to the client. Client as long as it is within the session, should pass
that cookie back to the server with each subsequent request.

Server has to also be aware of sessions and retrieve the session ID
from each incoming request.

-- 
Daniel Drozdzewski

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en