Welcome Guest, Not a member yet? Register   Sign In
Problem with sessions on multiple installations
#1

[eluser]1234qwer[/eluser]
Hello.


We need modules on codeigniter and the best option we found is multple installations (if you have suggestions in how to do it, I`m open mind), and now we have 2 modules one is the directory and the other a real estate module, then we are managing sessions on both modules with a pure php code, and now we are experiencing problems because some times it starts the session on both modules and when log out, some times works on both, but some times not, other times the php script says that it was initialized but no, that`s a mess.


Do you have any idea in how to do it in a good way??

thanks
#2

[eluser]Thorpe Obazee[/eluser]
I believe a better setup is to have multiple applications. Not entirely the full installation with different 'system' folders.
#3

[eluser]1234qwer[/eluser]
How can I have multiple applications?

And about the questions, I`m calling the log out ussing:

mysite.com/modulename/index.php/administrator/perform_logout


Is there any other way?

thnaks
#4

[eluser]Dam1an[/eluser]
[quote author="1234qwer" date="1240425499"]
How can I have multiple applications?
[/quote]
You can have any number of applications (the contents of system/application) pointing to the same installation (the contents of system)
All you need to do is change the relative paths in index.php
(Another advantage of this, is you just need to update the one installation, all all your applications benefit)

[quote author="1234qwer" date="1240425499"]
And about the questions, I`m calling the log out ussing:
mysite.com/modulename/index.php/administrator/perform_logout
Is there any other way?
[/quote]
I'm not sure what you mean by another way, but I always have the following route setup for logout
Code:
$route['logout'] = "path/to/logout/function";
and all you have to do in that function is destroy the session.
#5

[eluser]1234qwer[/eluser]
About the sessions, ¿Do I put the physical path? something like:


$route['logout'] = "dir\system\application\controllers\administrator.php\logout";

Because in administrator.php I have the following function:

function logout()
{
$this->session->sess_destroy();
$this->load->view('admin/login');
}

Am I right? or instead of:
$route['logout'] = "dir\system\application\controllers\administrator.php\logout";

I must put:

$route['logout'] = "http://www.mysite.com/modulename/index.php/administrator/perform_logout";

????
#6

[eluser]Dam1an[/eluser]
You put the path starting with the controller, so it would be
Code:
$route['logout'] = "administrator/logout";
#7

[eluser]Unknown[/eluser]
Hello, I am working with 1234qwer in the same script.

The problem is, I am excecuting the function to login and logout with ajax, the function always is being excecuted (I probe it), but codeigniter starts the session only sometimes, for example, I start the session using ajax, and all works correctly, then, if I stop the session excecuting a codeigniter function to do it using ajax, the session is stopped, but if I try to start the session again, it doesn't work.

The functions are working, but not always.

I don't know what to do, What do you say?




Theme © iAndrew 2016 - Forum software by © MyBB