Click here to Skip to main content
15,917,645 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
i want to navigate from one website to another
if the following is my current page
i want to navigate to the following in a linkbutton Click
if the second one having a login,then what can i do to implement this.
ie it needs id,staffname,company,level to get in..........
I used the following way
HttpCookie ID = new HttpCookie("id");
                ID.Value = opjn.stringEncode("136");
                HttpCookie STAFFNAME = new HttpCookie("staffname");
                STAFFNAME.Value = opjn.stringEncode("Johnny");
                HttpCookie LEVEL = new HttpCookie("level");
                LEVEL.Value = opjn.stringEncode("3");
                HttpCookie COMPANY = new HttpCookie("company");
                COMPANY.Value = opjn.stringEncode("54");

Response.Redirect(ConfigurationManager.AppSettings["Portal"] + "/", false);

Its not setting cookies properly
Forms Authentication is used for the second website login

Please help me
Updated 26-May-11 0:34am
cuteband 24-May-11 23:48pm    
You mean that your login is in different web application then if the login successful it will redirect you in different website?
kishore Rajendran 26-May-11 6:47am    
Be Yourself 25-May-11 1:02am    
I think you can retrive the cookie by
response.getCookies() which returns the array of Cookie objects from which you can retrive your cookie by the ID value.
If U dont have the ID value you can always get it by setting it to the session attribute or response attribute.

1 solution

First, I guess it is just your example that adds ID cookie multiple times instead of LEVEL and COMPANY, not real code? Second, consider using HttpCookie.Domain property (maybe Path property as well) to set domain for which cookie is valid. Otherwise current domain and path are used
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900