Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 18. Oct 2017, 18:29

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: 21. Jul 2008, 04:50 
Offline

Joined: 11. Jun 2008, 06:52
Posts: 13
Im including a file at the top of the tfu_upload.php that sets up the mysql connection and gets my site settings, and also checks to see if a user is logged in via the means of a cookie.

If the user is logged in, this said file sets $user_id to the id of the logged in user. tfu_upload.php runs a mysql query at the end of the upload to insert the item into the DB, and it needs to insert the user_id along with it, except that it wont read the cookie, and simply inserts nothing into the table column.

I tried to have it read the cookie directly in the tfu_upload.php and Im still getting nothing.


Top
 Profile  
 
 Post subject:
PostPosted: 21. Jul 2008, 05:40 
Offline

Joined: 11. Jun 2008, 06:52
Posts: 13
it also wont read session variables.


Top
 Profile  
 
 Post subject:
PostPosted: 21. Jul 2008, 09:42 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10494
Hi,

Right - blame the browser vendors and adobe for this.
the flash upload is almost treated like a new connection.

This is why I have a lot of workarounds to enable at least proper session handling.

But the upload is working? Then the session works too because the upload directory is passed by the session.

When do you set the session variables?
And you are not using Joomla?

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 21. Jul 2008, 17:17 
Offline

Joined: 11. Jun 2008, 06:52
Posts: 13
Im setting the session variable before upload even takes place, on a different page. Get it doesn't insert anything into the column where the user_id should be.

It uploads just fine.

Im not using joomla


Top
 Profile  
 
 Post subject:
PostPosted: 21. Jul 2008, 17:24 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10494
if the upload works then the session works fine to.

compare the session id's.

in tfu_upload.php is a section on the top you can uncomment and the the session id is written to the tfu.log.
compare it with the one you use.
make sure to pass the session id to the flash!

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 21. Jul 2008, 22:02 
Offline

Joined: 11. Jun 2008, 06:52
Posts: 13
Session ID and everything else is set on the page that has the uploaded embedded on.

I also have $_SESSION['logged_user_id'] set which contains the ID of the logged in user.

tfu_upload has the folowing line:
$loggedin_user_id = $_SESSION['logged_user_id'];
when I try to insert into the DB, it inserts $loggedin_user_id as 0. No matter what the actual ID is.


Top
 Profile  
 
 Post subject:
PostPosted: 21. Jul 2008, 22:05 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10494
have you done what I wrote before?

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 22. Jul 2008, 08:33 
Offline

Joined: 11. Jun 2008, 06:52
Posts: 13
Code:
07.22.2008 8:42:57 - session id : aef03c0dded10671230abedac290d94e

07.22.2008 8:42:57 - ERROR 8 in ome/users/2waffles/public/tfu_upload.php, line 7: Undefined index:  TFUSESSID

07.22.2008 8:42:57 - session TFU:

07.22.2008 8:42:57 - ERROR 8 in ome/users/2waffles/public/tfu_upload.php, line 8: Undefined index:  TFU_LOGIN

07.22.2008 8:42:57 - login:

07.22.2008 8:42:57 - ERROR 8 in ome/users/2waffles/public/tfu_upload.php, line 9: Undefined index:  TFU_DIR

07.22.2008 8:42:57 - dir:

07.22.2008 8:42:57 - ERROR 8 in ome/users/2waffles/public/tfu_upload.php, line 36: Undefined index:  logged_user_id


And session ids do not match if I echo it out on a regular php page.


Top
 Profile  
 
 Post subject:
PostPosted: 22. Jul 2008, 09:04 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10494
o.k. - how do you get an output at line 7 and 8?

the session_start is at line 28!

Do you have the output at the very top?

it has to be where I placed it - afte the restore_temp_session();

Because you say the upload works but you don't have TFU_LOGIN set - this is impossible.

and TFUSESSID is a parameter I send from the flash! Make sure you have NOT set session_name in the flash as parameter. If you do this you have of course to change TFUSESSID to this value.

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 22. Jul 2008, 15:22 
Offline

Joined: 11. Jun 2008, 06:52
Posts: 13
Im running a modified version of an older script. session_start() is right at the top of the file, because I include global.php at the very top, which makes the mysql connection, and gets user data.


Top
 Profile  
 
 Post subject:
PostPosted: 22. Jul 2008, 15:31 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10494
which version are you using?

Because I have added several session workarounds in the last year...

But if the upload works then the session works from the flash to tfu_upload.php - otherwise authentification fails!

- have you set session_id at the flash?
your main goal should be that the session id's inside tfu_upload.php and your page are the same!

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 23. Jul 2008, 08:53 
Offline

Joined: 11. Jun 2008, 06:52
Posts: 13
I have session_start() at the top of the file, but Im still getting a different session id.

Im using 2.5.1

I just tested the script in IE, and it works just fine. Both sessions match.

In FF, they do not.


Top
 Profile  
 
 Post subject:
PostPosted: 23. Jul 2008, 19:12 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10494
I added this session stuff in 2.6.

Do you start the flash with the session variable?
Because if the upload works the session inside tfu works too.

And I know only ff handles the flash like a new session if you don't use one of my workarounds.

/Michael


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO