Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-10-2012, 08:16 PM
Kozmek Kozmek is offline
 
Join Date: Dec 2011
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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:
Reply With Quote
  #2  
Old 12-11-2012, 01:39 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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;?>' } 
});
Reply With Quote
  #3  
Old 12-11-2012, 10:27 AM
Kozmek Kozmek is offline
 
Join Date: Dec 2011
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:10 PM.


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.03877 seconds
  • Memory Usage 2,187KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete