0

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

2 Answers 2

1

Have you read this post in Uploadify's manual about a bug in flash that prevents it from posting a session variable.

Sign up to request clarification or add additional context in comments.

2 Comments

didn't read it, it's actually frustrating..I've been looking for good uploader for three days and finally decided to use this one (even thought I didn't want to use flash in my site).
This link also looks like it may solve your issue. snipplr.com/view/15180/…
0
var token = getRandomNumber();
//put the token into session.
Session["myToken"] = token;

//use session variable
Response.write("<script> var tokenInJS = "+Session["myToken"]+"</script>");

3 Comments

The problem is not using the variable in JS from the Session or the variable 'token'..I don't think it will make any different, nay way I'll try it
I need more info about assigning variable to token and using token value lines. If it is like exactly on question, session using is wrong.
It must be like this. Put variable into session when user logins, pages first load, controls first load etc. and then use it everywhere u need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.