Session sharing for download managers? [solved]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Session sharing for download managers? [solved]

Post by Eric! »

Lets say I'm logged in wiith a session to devnetwork.net and I start a new browser instance. When the new instance goes to devnetwork.net it shares the already open session with the first browser instance. Is something special done to allow this?

Is there a way or a mechanism to do this with download managers? So a logged in user can launch a manager and share the authorized session for a download?

Right now the download manager is denied because its session data is empty. I've been doing an ip address comparison to authorize download managers of logged in users, but I don't like this method.

Any ideas on how to do this differently?
Last edited by Eric! on Tue Jun 30, 2009 8:27 am, edited 1 time in total.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Session sharing for download managers?

Post by VladSun »

Eric! wrote:Lets say I'm logged in wiith a session to devnetwork.net and I start a new browser instance. When the new instance goes to devnetwork.net it shares the already open session with the first browser instance.

Is something special done to allow this?
Yes, they are sharing the same cookie, with the same session ID stored in it.
Eric! wrote:Is there a way or a mechanism to do this with download managers? So a logged in user can launch a manager and share the authorized session for a download?

Right now the download manager is denied because its session data is empty. I've been doing an ip address comparison to authorize download managers of logged in users, but I don't like this method.

Any ideas on how to do this differently?
I'm not sure what you mean by download managers in this case... Do you mean it's "resume download" feature?
There are 10 types of people in this world, those who understand binary and those who don't
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: Session sharing for download managers?

Post by Eric! »

VladSun wrote: Yes, they are sharing the same cookie, with the same session ID stored in it.
How does the new instance share this?
VladSun wrote: I'm not sure what you mean by download managers in this case... Do you mean it's "resume download" feature?
These are plug-in or stand alone download accelerators which can open streams from multiple server mirrors (I'm just doing it on one server) to speed fie transfers. Firefox has a small one built in and the only feature is pause/continue.

If I allow downloads to only authorized sessions, the download tools are blocked. I would like to find a way to share the session, if possible. I am hoping there is a standard method for this between applications.

Thanks for helping, I know it's probably outside the normal php relm.
BornForCode
Forum Contributor
Posts: 147
Joined: Mon Feb 11, 2008 1:56 am

Re: Session sharing for download managers?

Post by BornForCode »

This is a server side, and is not related to php.
Try to look for something called: HTTP Status: 206 Partial Content and Range Requests.

Information that you server is sending should look like:

Code: Select all

 
HTTP/1.0 200 OK
Date: Mon, 05 May 2008 00:33:14 GMT
Server: Apache/2.0.52 (Red Hat)
Accept-Ranges: bytes
Content-Length: 3980
Content-Type: image/jpeg
 
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: Session sharing for download managers?

Post by Eric! »

BornForCode wrote:This is a server side, and is not related to php.
Try to look for something called: HTTP Status: 206 Partial Content and Range Requests.
No, I know all about this for supporting resumed downloads.

I'm talking about sharing a php session with a download accelerator. Like opening a second instance of a browser and having it automatically share an active session.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Session sharing for download managers?

Post by VladSun »

Eric! wrote:
VladSun wrote: Yes, they are sharing the same cookie, with the same session ID stored in it.
How does the new instance share this?
A cookie is a file - every instance of the browser can read it.
Eric! wrote:
VladSun wrote: I'm not sure what you mean by download managers in this case... Do you mean it's "resume download" feature?
These are plug-in or stand alone download accelerators which can open streams from multiple server mirrors (I'm just doing it on one server) to speed fie transfers. Firefox has a small one built in and the only feature is pause/continue.

If I allow downloads to only authorized sessions, the download tools are blocked. I would like to find a way to share the session, if possible. I am hoping there is a standard method for this between applications.

Thanks for helping, I know it's probably outside the normal php relm.
You may pass the session ID as a GET parameter and initialize the session with it.
This will work on a single server and as long as the session is active.
There are 10 types of people in this world, those who understand binary and those who don't
BornForCode
Forum Contributor
Posts: 147
Joined: Mon Feb 11, 2008 1:56 am

Re: Session sharing for download managers?

Post by BornForCode »

Then the load is moved on your download accelerator tool.

You must ensure that the download accelerator can read/create the cookies. Some download accelerators are able to authenticate (if you provide user and password) and start downloading using session sharing.
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: Session sharing for download managers?

Post by Eric! »

VladSun wrote:You may pass the session ID as a GET parameter and initialize the session with it.
This will work on a single server and as long as the session is active.
Yes, that's right. I am stupid. Put the session id in the URL. Duh. Thanks for clearing the fog....
Post Reply