why session expire after some time in codeigniterand how to customized it? - codeigniter

Hello I want to develop a chat application in CodeIgniter but there are lots of ajax call running in background when user logs in and chatting with each other.
Sometimes my ajax response displays login form HTML in chat form and i found out that my session getting expired. I do not know why its getting expired automatically so if someone can someone guide me to overcome this issue ?
It will be highly appreciated as well if someone guides me to use libraries or third part libraries (i.e Pusher for instance https://pusher.com/) which are helpful to built a better chat application using CodeIgniter.
Any help or suggestion would be highly appreciated.
Thanks

open this file in path : application\config\config.php and find out
$config['sess_expiration']
If you want to add some seconds then to session hold in set time

Related

Jmeter video call scenario

I need to achieve the below scenario using jmeter how can i do it please help
Login in to site with general user and schedule a appointment with doctor.
Login with doctor and accept appointment and video call the user at that time.
The user need to lift the video call and keep the session open for one min
Logout both the sessions.
please help how to achieve the above.
Use the WebDriver sampler as a core element and build your scenario with it.
Here's the basic tutorial.

Is running an ajax request every second bad?

I am currently trying to create a chat function and notifications function on my site that would get the current users logged in and notifications periodically from a mysql database and right now I have it set to do an ajax call every second to a php page which returns the users online and notifications back in a json object. I am just trying to make sure there isn't a better way of doing this that I can't think of. Also is doing an ajax call to my server so often bad? I would really appreciate any insight on this. Thanks in advance!
As long as you have a hand full of chatters: no. It is not the best design, but it will do the trick. If you are looking for scalable techniques look for Comet or Web Sockets.

Phonegap and Django Authentication

I am in the middle of building a PhoneGap (Cordova) app which I would like to be able to talk to a Django site of mine. The steps needed to get the app working are:
Authenticate the user (stay logged-in across app restarts) (e.g. get session cookie from Django for communication with the service - where to store?). Note: The Django endpoint uses https.
When app receives push notification load some data from my django site.
Make selection on data and submit response back to my django site (will need the csrf token?)
I was able to sort out the push notifications but now I am wondering which solution would work best for the communication with Django.
As I understand there are two possible approaches:
Either to implement a REST service with something like tastypie or
try to setup the communication via ajax (e.g. jQuery)
At the moment I am thinking that going simply ajax might be the best approach since the app is fairly small and there are no additional requirement for a REST API.
It would be great if anyone could give me any pointers on how to solve this or share some experiece / code. Especially the steps of the authentication process are unclear to me.
I am not sure if this is still an open question but it is sure an interesting one.
I would strongly suggest on using the django-tastypie and you could start by using the docs which are indeed a great point of reference.
My experience until now has shown that I should always start by making my api clear(and rest) than choosing an easier faster solution(e.g. ajax) because if your app is a successful one, frameworks like tastypie help you scale.
The authentication process is pretty straightforward if you choose the basic one.
You just ask for the user credentials and there are many clients implementing the client side basic auth.
Fortunately, tastypie supports more than this. For example, the api authentication and you could read more here.
If you need anything else, please let me know.
Regards,
Michael.

Consuming SOAP web service for a cocoa application

I am trying to consume a SOAP web service into a cocoa application. The return value which is printing in the log is an HTML error page.
My Main objective is to pass two parameters to the web service and get a value in response. Can anyone please suggest correct way of achieving this?
It could be any number of things. For startes: you may be hitting the wrong URL, you may be sending invalid data and the server is not returning a valid error. The best thing to do is check what you are doing against any docs you may have, then contact the person working on the server side of the project for help debugging.
I know that is not a very specific answer, but I don't have a lot to go on. Hope it helps.

Sessions and Cookies in Mobile Application

I am a newbie to Mobile application development, i got stucked with a query like... Is it possible to use cookies & sessions in mobile browser/Mobile Application ?. if so please provide some resource...
if anybody aware of it, please let me know
Thanks in Advance.
sessions work on cookies. cookies work on mobiles (otherwise you'd never be able to sign in to any websites on a mobile device). In short, Yes.

Resources