CodeIgniter Forums
cookies dont work correct - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: cookies dont work correct (/showthread.php?tid=28267)



cookies dont work correct - El Forum - 03-06-2010

[eluser]axisdude[/eluser]
Im having a problem with the cookies from my site.
Each time people need to login again...
I have tried many settings but nothing will help
can some1 please tell me the correct settings for the config?
My site is on linux server in var/html/folder
in the "html" are more sites hosted in different folders, all with CI.
here is my config:
Code:
|--------------------------------------------------------------------------
| 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"]        = "xu2";
$config["sess_expiration"]        = 72000;
$config["sess_encrypt_cookie"]    = TRUE;
$config["sess_use_database"]    = TRUE;
$config["sess_table_name"]        = "sessions";
$config["sess_match_ip"]        = FALSE;
$config["sess_match_useragent"]    = TRUE;
$config["sess_time_to_update"]     = 300;

/*
|--------------------------------------------------------------------------
| Cookie Related Variables
|--------------------------------------------------------------------------
|
| "cookie_prefix" = Set a prefix if you need to avoid collisions
| "cookie_domain" = Set to .your-domain.com for site-wide cookies
| "cookie_path"   =  Typically will be a forward slash
|
*/
$config["cookie_prefix"]    = "adultpics";
$config["cookie_domain"]    = ".adultpichost.eu";
$config["cookie_path"]        = "/";

/*

must i change cookie path?
is all correct?
i tried setting sess_expiration to 0 but it dont work. still loggedout after browser close.
btw in my database i can only find dlsessions table, but no sessions table.
my url: www.adultpichost.eu


cookies dont work correct - El Forum - 03-06-2010

[eluser]nkm82[/eluser]
You must create the session table manually.

Also, I recommend you to always check the User Guide first, you'll find answers to most of your questions.

http://ellislab.com/codeigniter/user-guide/libraries/sessions.html


cookies dont work correct - El Forum - 03-06-2010

[eluser]axisdude[/eluser]
ive read it.
so without database there are no cookies?


cookies dont work correct - El Forum - 03-06-2010

[eluser]nkm82[/eluser]
[quote author="axisdude" date="1267932345"]ive read it.
so without database there are no cookies?[/quote]

Sort of. If you set 'sess_use_database' to TRUE and don't create the required database table, there won't be session storage.


cookies dont work correct - El Forum - 03-06-2010

[eluser]axisdude[/eluser]
ok so the only thing i need todo is creating a database table and then im done?
ir do i need to edit some files also?


cookies dont work correct - El Forum - 03-06-2010

[eluser]nkm82[/eluser]
Yes. Just check that the name of the table matches with the one in the config.


cookies dont work correct - El Forum - 03-07-2010

[eluser]axisdude[/eluser]
heya,

I loaded the table into the database and eddit the config.php
But still nothing..... after i close the browser and the open it again, im logged out each time.
Can some 1 give me step by step tutorial on what i need todo and change?
Its very anoying to need to login all the time....


cookies dont work correct - El Forum - 03-08-2010

[eluser]InsiteFX[/eluser]
Read the users guide!

Sessions

Enjoy
InsiteFX


cookies dont work correct - El Forum - 03-08-2010

[eluser]axisdude[/eluser]
Ive read it.
Im not an expert with CI...
I having troubles to understand what it is exactly what i need todo.
Perhaps its easyer that some1 tell me wich files are all needed for the cookies to work, then i can post them here.
then you can have a look on whats wrong.

Im using premade script fom xtrafile, since their support is not available im looking here for support.
so.. sorry for my noob questions.
thx in advantage.