I'm having application in codeigniter already, now i'm developing the android from this application. Using this application as a server side and doing client console in android. In server i'm maintained the session. But in android request i can't maintain the session. Instead of that i'm creating GUID in server at the first request of login request and storing at client side and also storing at customer table, afterwards for each request client will send the GUID for authentication. Now what is my problem is each request getting from android codeigniter create session with different session id(each request generating new session id). How to avoid creating session and storing into database.(Only for android request, but browser request it have to store)
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
I managed to extend CI_Session in Codeigniter 3.1.3. Here is what I did:
Create a file application/libraries/Session/MY_Session.php
You might also want to add 'session' to your config/autoload.php:
Your question is rather old now, but for anyone who has this problem you should extend the CI_Session library and override the sess_create method. Within your method, test to see what user agent is making the request. Then you only allow a session to be created if the user agent is NOT an android platform.