Saturday, 15 May 2010

asp.net - RedirectUrl info lost after doing postback in client-side code -


My login page works like this: when you enter it, javascript reads some of your information, Writes in the input and submits so that the read data can be read and processed on the server.

  & lt; Script language = "javascript" type = "text / javascript" & gt; Function getUserInfo () {var userInfo = xyz.GetSecureBox (); Form1.info.value = userInfo; Form1.read.value = "true"; Form1.submit (); } & Lt; / Script & gt;  

Depending on the data provided, the server code authenticates the user or not

The problem is that when you try to enter a different page , Then make it the default .aspx, you are redirected to the page login with the redirect URL parameter so that you can be certified. But after postback I have lost the javascript redirectUrl information. How can I protect it?

OK, I can definitely read that string string parameter in JS and write it in some input. How do I use query string parameters in JS? And maybe there is a different way?

The only way I can think about session and / or cookie.

If using the query string and parsing in JS, then you have to code yourself. There are so many code out there that are doing this eg.


No comments:

Post a Comment