PDA

View Full Version : Session Sharing




sivaprakash
May 4, 2011, 09:09 AM
Hi

I am writing client server application (http://www.cocoadev.com/index.pl?DistributedObjectsSampleCode). In the client I am creating a session with my webserver and doing certain operations, that works well. But when I pass all my cookies, header information from client to server and perform the same operation it is not going through. It says "Session is not Valid".

Anything need to turned on at system level?

Thanks
Siva



ulbador
May 4, 2011, 11:05 AM
I'm not sure exactly what you are trying to do, but I'll relate a story that might help you if you are trying to interact with a web server. You mention web server, so I assume this is the case.

I've run into a similar situation when using a Java applet to upload files. Basically, the Java applet embedded in my web page would end up getting a different session id than my browser would. This would happen because the Java applet would not know anything about the session that the web browser had, and request a new one from Apache/IIS.

Could this be what is happening to you? If so, you may just need to make sure you are passing around the PHPSESSIONID/ASPSESSIONID/etc cookie between the various parts of your code and making sure that code is getting sent to the server with every request. Using the available cocoa classes to do such a connection, you would need to make sure to associate this information with every request, particularly if your object making the request is allocing, deallocing.