tags:

views:

456

answers:

1

I am using my App to login to a website and access information from there. I have a few questions...

I am using multiple files / screens to access information after I have logged in. On the page which does the login, I am able to output all the Cookie data to an NSLog. The Cookie consists of a SESSIONID. I am then able to navigate through other screens which require the SESSION. Obviously the SESSION is still intact, but how can I get that Cookie data while on other screens?

More specifically, if I am on a later screen and need to put the SESSIONID into a variable so I can use it in the code, how would I extract that SESSIONID from the Cookie and put it into a variable that I can use?

I have been banging my head on this for a few days now and been searching all over. The guys at pragprog.com suggested I try here.

Thanks for any help you can provide.

A: 

You could put an instance variable in your application delegate with a readwrite property. Then you would set its value to the session id derived from the cookie. As this delegate is accessible to all "screens" (view controllers?) the instance variable would be accessible, as well.

Alex Reynolds
So can I not access the cookies directly once I have moved on to another view control, even though it seems that the App is still gaining access to the secure areas using the Cookie / SessionID?
Chris
I don't know. Part of the problem is that I don't know what you are doing in your application. How are you accessing the Cookie/SessionID now? Have you tried to do the same thing in the different view controller? Perhaps if you post some code it might help.
Alex Reynolds