Welcome Guest, Not a member yet? Register   Sign In
sessions not enabled on go daddy server
#1

[eluser]labao[/eluser]
Hello, I am using codeigniter to build a car rental website and I am having trouble implementing it on a godaddy server. I am still in school so forgive me for not being so technical but the sessions that I am putting variables into don't seem to want to be recorded.
I am using the following come to dump the var into session data:

Code:
$vehicle=$this->input->post('vehicle');
then
Code:
$this ->session->set_userdata('vehicle', $vehicle);

and then I am pulling the vars out on the last page via this line of code:
Code:
$car=$this->session->userdata('vehicle');
   echo $car;

Also this code works locally... but not remotely. I can go to the website and go through all the steps and have it run perfectly on my machine but when I go try it on another computer, the sessions aren't created and the application doesn't work.

Any help is appreciated. This is a school project and time is of the essence!

Thanks,

Lorne.
#2

[eluser]labao[/eluser]
note - I am pretty sure this is a server issue because I developed the site using localhost however, changed all the database params in the config file...
#3

[eluser]cahva[/eluser]
Does it fail using database and without? Also if time is not on your side, you could try the native PHP session library. I have used this found here:
http://www.philsbury.co.uk/index.php/blo...-sessions/

It works just like the normal session library so you dont have to change any code. Just copy that to application/libraries and load the session library normally.
#4

[eluser]labao[/eluser]
Thanks for the reply... for some reason I am getting an internal server error when I surf to the site. I am hoping it's just a .htaccess issue and I can surf to the site within the hour. I'll try your solution as soon as I can.
#5

[eluser]labao[/eluser]
ok It's up I am going to try your solution now...

lets hope it works because this is all that stands between a pass an a fail for me due to the fact that it's the only project we've been doing for past 4 months.
#6

[eluser]labao[/eluser]
Code:
$this->load->library('session');

would go into the config/autoload file yes? under libraries?

if yes it still doesn't work...
#7

[eluser]labao[/eluser]
I think it's actually the user userdata that isn't being recorded... I can get a session ID and it will get logged into the server...
#8

[eluser]labao[/eluser]
perhaps someone could tell me what the actual name of this process is called and then I can call godaddy and ask them whats going on. Like I said, the site works locally while on the actually website. not using a local server. but doesn't work remotely. Im trying to assign multiple vars to the userdata column in my ci_sessions table... EVERYTHING else in the table is being recorder EXCEPT userdata.

is the userdata function reliable on the server?
#9

[eluser]xoRiZ[/eluser]
[quote author="labao" date="1270852497"]
Code:
$this->load->library('session');

would go into the config/autoload file yes? under libraries?

if yes it still doesn't work...[/quote]

application/config/autoload.php
Code:
$autoload['libraries'] = array('session');


What does your config.php look like for sessions?

Code:
# This section

/*
|--------------------------------------------------------------------------
| Session Variables
|--------------------------------------------------------------------------
|
| 'session_cookie_name' = the name you want for the cookie
| 'encrypt_sess_cookie' = TRUE/FALSE (boolean).  Whether to encrypt the cookie
| 'session_expiration'  = the number of SECONDS you want the session to last.
|  by default sessions last 7200 seconds (two hours).  Set to zero for no expiration.
| 'time_to_update'        = how many seconds between CI refreshing Session Information
|
*/
$config['sess_cookie_name']        = 'ci_session';
$config['sess_expiration']        = 7200;
$config['sess_encrypt_cookie']    = FALSE;
$config['sess_use_database']    = FALSE;
$config['sess_table_name']        = 'ci_sessions';
$config['sess_match_ip']        = FALSE;
$config['sess_match_useragent']    = TRUE;
$config['sess_time_to_update']     = 300;


Can you post this, as well as, any pertinent error logs?


EDIT:

Also, in the code you posted above, your accessor appears to be spaced.

Code:
$this ->session->set_userdata('vehicle', $vehicle);

# Make sure it reads
$this->session->set_userdata('vehicle', $vehicle);

I'm not sure if this would cause the issue or not. EDIT: Tested, this won't cause an issue.


Have you verified that $this->input->post('vehicle') is not null?

If you're able to $this->session->userdata('session_id') and get a variable- I would doubt it's the session class.
#10

[eluser]labao[/eluser]
My config.php is fine.

no I am not getting any errors at all actually which makes this rather annoying. $vehicle is not null and is being posted via a form then is sent to a controller which will input the var and then I will take that var out on the next page

Quote:$this->session->userdata('session_id')
does in fact give me a variable...




Theme © iAndrew 2016 - Forum software by © MyBB