Welcome Guest, Not a member yet? Register   Sign In
Session not work on server
#11

[eluser]Unknown[/eluser]
I was having a similar problem today. I had a CI site that worked perfectly on localhost. When I moved it to a Ubuntu server that I had just set up at home the site looked like it was working, but when I tried to login I was losing all $_POST data and session info (both returned empty arrays).

After an embarrassingly long time I realized that I had not enabled mod_rewrite on the server. Once that was enabled the problem was solved.

Hope that will help someone who's having the same problem.
#12

[eluser]Unknown[/eluser]
I have Just Changed on line of code and its working perfectly.
Code:
change

$config['sess_expiration'] = 7200;

to
$config['sess_expiration'] = 86400;
#13

[eluser]salvomil[/eluser]
I know this is an old issue, but having the same problem I googled and finally found the problem:

set an ntp server to adjust the time of server (in google chrome the session is lost...)

I found the solution here (thank you!):

http://strangerzlog.blogspot.it/2012/04/...ns-on.html

so when the expiration time is changed with an higher value, of course you seem to have the problem found but this is not true, changing the time is the solution! (I think).

Bye
#14

[eluser]aherus[/eluser]
Hi guys,

i know that is an old topic, but i'm in developing an app for my client and still get the session issue on his server. On my localhost everything works perfect. I checked 10 times my code for whitespaces or closed ?> tag, tried 10^6 solutions over internet and nothing works for me. I really get nervous with this. It's not my first app in CI, but first that doesn't work properly. Maybe someone of You could help me solve the problem, I'll be very grateful.

Code:
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /var/www/clients/client61/web237/web/medmar/system/application/controllers/admin_controller.php:1)

Filename: libraries/Session.php

Line Number: 675

I noticed that this error occurs when i tried load the session lib, via controller, model or autoload. Can it be a server config issue? mod_rewrite = on. Any solutions or inspiration?




Theme © iAndrew 2016 - Forum software by © MyBB