vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Uploadify Session (https://vborg.vbsupport.ru/showthread.php?t=292860)

Kozmek 12-10-2012 07:16 PM

Uploadify Session
 
Hi guys,

I have a strange session problem that I have been scratching my head over. This particular problem only appears to be on Internet Explorer and only happens when you use the session table and not cookies.

What I have is an external page VB page that has an upload function.

I use uploadify (http://www.uploadify.com) which is a flash based file uploader. When I upload a file and return the results, for some reason a new session gets created for the user and the previous session isn't used, resulting in the user being logged off once a page is refreshed or when you want to submit the whole form.

Now what uploadify are saying is

Quote:

In Uploadify, the Flash file is what communicates with the backend script. Because of a bug in Flash, the session cookie is not picked up by the Flash file. To circumvent this, you will need to pass the session data via the formData option. To do this in PHP, use the following code when initializing Uploadify on the front-end page:
http://www.uploadify.com/documentati...ith-uploadify/

They are suggesting in using

PHP Code:

$('#file_upload).uploadify({
    // Your normal options here
    formData : { '<?php echo session_name();?>' : '<?php echo session_id();?>' }
});

But as far I know, this method of session isn't used in vbulletin?:erm:

So I have tried adding

PHP Code:

$s $vbulletin->session->vars['dbsessionhash']; 

then used this in the javascript portion

formData : { 's' : '$sessionhash' }

but no dice. Anyone has any other suggestions? Anything that I have come across regarding uploadify was to do with session_start() which is no use?

Many thanks and hope someone can help me out :up:

Simon Lloyd 12-11-2012 12:39 AM

Unfortunately you'll probebly not get your answer here as it's not a plugin developed here or to do with any core vbulletin files, however, they are showing you that they would use echo to enter the sessions has so i assume you'd want something like
PHP Code:

$idhash = md5($_SERVER['HTTP_USER_AGENT'] . $vbuser['userid']);
$sessionhash = md5($now . request_uri() . $idhash . $_SERVER['REMOTE_ADDR'] );
$('#file_upload).uploadify({ 
    // Your normal options here 
    formData : { '<?php echo $sessionhash;?>' : '<?php echo $idhash;?>' } 
});


Kozmek 12-11-2012 09:27 AM

Hi Simon,

Thanks for the reply. I understand that this might not be anything to do with Vbulletin although I am using the backend completely.

I will give this a go, I am wondering, if I do manage to pickup the current ID hash and Session Hash, how do I tell vbulletin to use this in a session, rather than creating a new session as it is doing right now?

Even if it is not using uploadify. Would the sessionhash as a $_POST['$sessionhash'] variable be picked up by vbulletin automatically and check if it exists or is there a special variable I can use?

During the upload function I can pull all the details from session class, is there another class I can use to re-instate the session at all?

Many thanks


All times are GMT. The time now is 09:24 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01572 seconds
  • Memory Usage 1,722KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete