Ignition code for transmitting database session_id in view

I'm trying to get Uploadify to work with a code igniter, but I have the same problem as anyone who has a new session created for "ShockWave Flash", and not to collect an already created session.

I have the following settings:

$config['sess_cookie_name'] = 'session'; $config['sess_expiration'] = 7200; $config['sess_expire_on_close'] = FALSE; $config['sess_encrypt_cookie'] = TRUE; $config['sess_use_database'] = TRUE; $config['sess_table_name'] = 'sessions'; $config['sess_match_ip'] = TRUE; $config['sess_match_useragent'] = FALSE; $config['sess_time_to_update'] = 300; 

The code ignition session table looks like this With BROWSER

  session_id: 73b05af777af0e6a56e7bbba8f9714f6 ip_address: 127.0.0.1 user_agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/53 last_activity: 1310341663 user_data: a:6:{s:5:"email";s:32:" test@hotmail.com "} 

With UPLOADIFY

  session_id: d39bce3d9c734081379b286449cf56ce ip_address: 127.0.0.1 user_agent: Shockwave Flash last_activity: 1310341167 user_data: 

I am trying to hack this and add the session_id browser as php access so that when I boot, I can get the user's session data, given the session ID.

  $(document).ready(function() { $('#uploadify').uploadify({ 'uploader' : '/uploadify/uploadify.swf', 'script' : '/index.php/upload/uploadify/'.$this->session->userdata('session_id').'', 

My question is: 1) Is it bad that I publicly display session_id in the source, is session_id accessible even if I do not? 2) In the controller "upload", how can I "upload" this session_id or get data from it?

+1
source share
1 answer
  • The only way that this can create a problem is if you encrypt the session_id cookie - otherwise you will no longer give the user real data. (So, yes, in most cases they can get this data anyway)
  • You will need to overwrite sess_read() or __construct in the MY_Session class to look at the user variable or you can change the cookie

Mainly:

 public function __construct( $id ) { // a hack, but you need a hack $_COOKIE[ $this->sess_cookie_name ] = $id; parent::__construct(); } 
+1
source

All Articles