Welcome Guest, Not a member yet? Register   Sign In
Session problem or Tinymce problem???
#1

[eluser]Deathcode[/eluser]
hello everybody,

i have a problem saving data into database but i don't know why this is happen???

i have a textarea (tinymce), when i type something in there it's work fine(i can save the data) but when i copy paste article, that data can be save but it's empty. what is the problem???

FYI : i use textarea(tinymce) and then saved that data into session to preview (if there is no problem) and submit it into database, but before that data insert to the database i'll check data in session but my data is blank.

this is my code :

Code:
$data = array(
            'filename' => $filename,
            'company' => $this->input->post('company'),
            'url' => $this->input->post('url'),
            'userfile' => $logo,
            'email' => $this->input->post('email'),
            'jobtype' => $this->input->post('jobtype'),
            'jobcategory' => $this->input->post('jobcategory'),
            'location' => $this->input->post('location'),
            'occupation' => $this->input->post('occupation'),
            'description' =>$this->input->post('description'),
            'jobperks' =>  $this->input->post('jobperks'),
            'howtoapply' =>  $this->input->post('howtoapply')
        );
        
        $this->session->set_userdata($data);

this is my session setting :

Code:
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration']        = 7200;
$config['sess_encrypt_cookie']    = TRUE;
$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;

this is my setting init tinymce :

Code:
tinyMCE.init({
        mode : "exact",
        forced_root_block : false,
        init_instance_callback : "myCustomInitInstance",
        elements: "mce_tiny1",
        force_p_newlines : false,
        force_br_newlines : true,  
        theme : "advanced",
        theme_advanced_buttons1: "bold,italic,underline, strikethrough, separator,justifyleft, justifycenter,justifyright,  justifyfull, separator,bullist,numlist,link,unlink",
        theme_advanced_buttons2: "",
        theme_advanced_buttons3: "",
        theme_advanced_buttons4: "",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
    });
#2

[eluser]Dennis Rasmussen[/eluser]
Hi Deathcode,

You are using a cookie-session with encryption enabled.
The encryption of a session gives a bigger size of data than the actual data and a cookie can only hold 4KB of data.
So when you try to store a big article in a session (cookie) you exceed the limit and the session won't work.

I strongly suggest that you set the configuration to use a database to store your sessions.
Read the documentation here: http://ellislab.com/codeigniter/user-gui...sions.html


Note: If you must have that much data in a session, there is no other way to fix your issue. You have to store the data in a session that is stored in your database. It is very simple to setup and CodeIgniter will do most of the work for you.
#3

[eluser]Deathcode[/eluser]
Hi dennis,

i already check the problem yesterday, i don't think the problem is in CI session. I think the problem is in tinymce because when i remove the style like span tag, CI session can store the data but, this is my temporary asumption. Now i want to try to remove the style in tinymce. if you can tell me how to remove the style in tinymce i will appreciate it.

thanks...
#4

[eluser]Deathcode[/eluser]
Hello Dennis,

you're right about The encryption of a session gives a bigger size of data than the actual data, when i turn off the encryption and test posting i can get back the value from the session. I think i will follow your advise to use database session. thanks you very much dennis....




Theme © iAndrew 2016 - Forum software by © MyBB