问题
I'm using Uploadify to upload files in my site and in order to make upload more secure I create 'token' (random number) in server side once the page loaded and put it in Session and in JS variable so that when I start upload files I send the same token back to server.
The problem is when sending it back I traced the code and the session values all lost, looks like its another session.
How is that happening and how can I fix it?
Here's a pseudo code in ASP.NET:
Server side
var token = getRandomNumber();
Session["myToken"] = token;
Response.write("<script> var tokenInJS = "+token+"</script>");
Thanx
回答1:
Have you read this post in Uploadify's manual about a bug in flash that prevents it from posting a session variable.
回答2:
var token = getRandomNumber();
//put the token into session.
Session["myToken"] = token;
//use session variable
Response.write("<script> var tokenInJS = "+Session["myToken"]+"</script>");
来源:https://stackoverflow.com/questions/10469227/cant-see-any-session-values-when-using-uploadify-in-asp-net