Cookie
-
Hi, i wanna know how can i get a cookie for example: mypage.com/login.html This, have a form to login, so: mypage.com/login.html?user=teste&pass=test Will login with User= teste and Pass = test Im just trying to get the COOKIE, provided by login.html after the login. What can i use? Thanks
-
Hi, i wanna know how can i get a cookie for example: mypage.com/login.html This, have a form to login, so: mypage.com/login.html?user=teste&pass=test Will login with User= teste and Pass = test Im just trying to get the COOKIE, provided by login.html after the login. What can i use? Thanks
First of all, this really belongs in the Web Developer forum. This forum is for questions relating to C#, which can be used to create ASP.NET web applications that parse, compile, and execute code on the server so format and stream HTML to (and other files) to the browser or other client application using HTTP. Second, if you want to use ASP.NET, then by default the pages use the .aspx extension, not .html. Third, by using .html extensions, you are implying that you want to do this using client-side scripting, since .html is, by default, not a CGI-parsed extension on any system without actually remapping file extensions. Fourth, are you kidding? Passing the username and password in a query string is the most insecure method ever conceived! You might as well eliminate authentication. You pass username and passwords using POST (not GET) and you should use SSL over HTTP (HTTPS) if this is sensitive information. Even without using SSL, using POST at least doesn't store the username and password in the browser's history like this would. After taking all that above into account, how you do this depends on what server you're using and lots of other information. Again, I suggest you ask this in the Web Developers forum.
Microsoft MVP, Visual C# My Articles
-
Hi, i wanna know how can i get a cookie for example: mypage.com/login.html This, have a form to login, so: mypage.com/login.html?user=teste&pass=test Will login with User= teste and Pass = test Im just trying to get the COOKIE, provided by login.html after the login. What can i use? Thanks
-
Well, u dont understand... I trying to acess a protected page with HttpWebRequest...but i need get the cookie first, to put in the CookieCollection :\
Moon Boy wrote: Well, u dont understand No, it's you that don't understand. First of all, this isn't even using cookies. This is a query string, and if you have questions about ASP.NET (which your URLs didn't show at all, since they use the .html files which are typically staticly delivered on the server) they belong in the ASP.NET forum. If you're using the
HttpWebRequest
to access this site, then you need to pass the query string parameters as part of the URL. If the site is using cookies, then instantiate a newCookieContainer
and add aCookie
. The documentation for theHttpWebRequest.CookieContainer
property in the .NET Framework SDK even gives an example of how to do this. Consulting the documentation should be the first place you check. Also, when you want to reply to someone in the CodeProject forums, click "Reply" on the message to which you want to reply.Microsoft MVP, Visual C# My Articles
-
Moon Boy wrote: Well, u dont understand No, it's you that don't understand. First of all, this isn't even using cookies. This is a query string, and if you have questions about ASP.NET (which your URLs didn't show at all, since they use the .html files which are typically staticly delivered on the server) they belong in the ASP.NET forum. If you're using the
HttpWebRequest
to access this site, then you need to pass the query string parameters as part of the URL. If the site is using cookies, then instantiate a newCookieContainer
and add aCookie
. The documentation for theHttpWebRequest.CookieContainer
property in the .NET Framework SDK even gives an example of how to do this. Consulting the documentation should be the first place you check. Also, when you want to reply to someone in the CodeProject forums, click "Reply" on the message to which you want to reply.Microsoft MVP, Visual C# My Articles