[問題] 上傳Youtube後瀏覽器的session問題

看板Python作者 (iSuck)時間12年前 (2013/06/08 00:22), 編輯推噓4(402)
留言6則, 3人參與, 最新討論串1/1
學校有一個Project要做,因為自己是web新手只能自己慢慢刻,遇到了一個很麻煩的問題 不知道如何解決orz,所以來這邊請教各位: 整個系統的步驟如下: 1. 使用者在我的網頁上輸入影片的資料 2. database儲存輸入的資料,然後拿去跟Youtube要一次性的上傳URL跟Token 3. 用URL/Token生出一個Form以Post的方式上傳到Youtube,action必須加上 nexturl的屬性告訴google上傳完要redirect去哪 (actioin="https://path.to.upload/?nexturl=http://redirect.to.me") 4. 上傳完成後google會用HTTP Redirect的方式把Browser導回我的網頁, 上面加上status=200&id=<video_id>通知上傳的youtube video_id (http://redirect.to.me/?status=200&id=<video_id>) 問題出在這裡,redirect回來後我要怎麼知道這個video id是從哪一個Browser session( 第二步存在database的資料)生出來的? 系統必須支援同一個人用多個tab同時上傳一堆影片,我看了一下django的session 他是based on cookie,後面的cookie寫入會影響到前面的上傳。 是我搞錯了什麼,還是我用的方法根本錯了? 謝謝大家。 -- It's a funny thing, ambition. It can take one to sublime heights or harrowing depths. And sometimes they are one and the same. Roseburrow learned that lesson all too well. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 1.170.12.66

06/08 12:02, , 1F
不太清楚你的問題:你想問生出來的video_id是從哪個
06/08 12:02, 1F

06/08 12:03, , 2F
session來的,還是想知道video_id是從哪一筆使用者輸入
06/08 12:03, 2F

06/08 12:04, , 3F
的資料來的?
06/08 12:04, 3F
是的

06/08 13:38, , 4F
你可以在 redirect.to.me 的 url 加上 session
06/08 13:38, 4F
喔對...這樣就行了orz 在redirect.to.me加上get參數就能知道自己是哪一個 真是傻了我orz... ※ 編輯: doomleika 來自: 1.170.118.140 (06/08 16:13) ※ 編輯: doomleika 來自: 1.170.118.140 (06/08 16:13)

06/10 15:45, , 5F
謝謝原 po 的紅包....:p
06/10 15:45, 5F

06/18 15:04, , 6F
謝謝紅包XD
06/18 15:04, 6F
文章代碼(AID): #1HiWYuTP (Python)
文章代碼(AID): #1HiWYuTP (Python)