Welcome Guest, Not a member yet? Register   Sign In
Session and cookie information lost when using Flash
#11

[eluser]WanWizard[/eluser]
You haven't missed this part?
Code:
$this->CI =& get_instance();

Note that it's not a good idea to modify core classes this way. If you need this, you are better off extending them.
#12

[eluser]nmormino[/eluser]
This is sort of an old topic. Not the most secure way, but I did this by setting a random code in the config and posting that random string with the flash upload. You may also want to look at the CI 2.0 (I realize CI 2.0 wasn't available at the beginning of this thread) csrf_protection. Once again not the MOST secure method, but would probably be good enough for most needs. Especially if the users have to be logged in in the first place to access those particular features.
#13

[eluser]Fatih[/eluser]
Update for CI Version 1.7.x and 2.0.x:

You must add session id into view file as an paramater:

Code:
post_params: {"PHPSESSID": "<?php echo  $this->session->userdata('session_id');?>"},

After that, setting up in your config file as given below:

Code:
$config['sess_match_useragent']    = FALSE;

Because $this->sess_run(); command was removed new versions.
#14

[eluser]villlllle[/eluser]
[quote author="Fatih" date="1304539729"]Update for CI Version 1.7.x and 2.0.x:

You must add session id into view file as an paramater:

Code:
post_params: {"PHPSESSID": "<?php echo  $this->session->userdata('session_id');?>"},

After that, setting up in your config file as given below:

Code:
$config['sess_match_useragent']    = FALSE;

Because $this->sess_run(); command was removed new versions.[/quote]


Do you still need to do something to the Session library?

My problem is that I've upgraded to CodeIgniter 2 and SWFUpload started throwing 302 errors because of the same old session id problem I had fixed with this forums help with CI 1.7. Now it seems I have to spend a day doing this all over again :/

My main problem seems to be initializing the session with the original session id that's been passed on in the POST.

I'd really appreciate if you could briefly explain if you did any other changes to your controller of Session library for CI2.

Thanks!
#15

[eluser]Fatih[/eluser]
[quote author="villlllle" date="1305079824"]

Do you still need to do something to the Session library?

My problem is that I've upgraded to CodeIgniter 2 and SWFUpload started throwing 302 errors because of the same old session id problem I had fixed with this forums help with CI 1.7. Now it seems I have to spend a day doing this all over again :/

My main problem seems to be initializing the session with the original session id that's been passed on in the POST.

I'd really appreciate if you could briefly explain if you did any other changes to your controller of Session library for CI2.

Thanks![/quote]

@villlllle: I didn't change anything in my session libraries. But I changed on my application/config.php file:

Code:
$config['sess_cookie_name']        = 'cisession';

Because I read about many posts that IExplorer doesn't like some session names (like that "ci_session").
#16

[eluser]InsiteFX[/eluser]
IE Does not like the underscore!

InsiteFX
#17

[eluser]villlllle[/eluser]
[quote author="Fatih" date="1305111191"]

@villlllle: I didn't change anything in my session libraries. But I changed on my application/config.php file:

Code:
$config['sess_cookie_name']        = 'cisession';

Because I read about many posts that IExplorer doesn't like some session names (like that "ci_session").[/quote]

Thanks, I did that. No help, however. I'm testing on Firefox.


I have this in the beginning of the function called by Flash:

Code:
function upload(){

    $params['session_id'] = $this->input->post('PHPSESSID');
    $this->load->library('session', $params);
    
    log_message('debug', "Params session id = ". $params['session_id']);
    log_message('debug', "Current session id = ". $this->session->userdata('session_id') );

The debug log with IE is ok:
Quote:DEBUG - 2011-05-11 12:23:41 --> Session class already loaded. Second attempt ignored.
DEBUG - 2011-05-11 12:23:41 --> Params session id = 3564756204730be2d0ff37fd2aa61755
DEBUG - 2011-05-11 12:23:41 --> Current session id = 3564756204730be2d0ff37fd2aa61755

The debug log with Firefox/Chrome/Safari indicates that the session isn't working right:
Quote:DEBUG - 2011-05-11 12:18:02 --> Session class already loaded. Second attempt ignored.
DEBUG - 2011-05-11 12:18:02 --> Params session id = 414830241ac4caa4b79286444c84647e
DEBUG - 2011-05-11 12:18:02 --> Current session id = 89afd2ee8fe36cfd9695390216fe743a


Any idea what's wrong? Obviously I'd like this to work on any browser Smile
#18

[eluser]Fatih[/eluser]
Also, I use database option for session saving. What is it on your side?
#19

[eluser]villlllle[/eluser]
[quote author="Fatih" date="1305125534"]Also, I use database option for session saving. What is it on your side?[/quote]

I turned it on, still no help on Firefox :|
#20

[eluser]Fatih[/eluser]
You can check and evaluate on database side that why the session can be changed. I think there is a more useful of error analysis for you.




Theme © iAndrew 2016 - Forum software by © MyBB