473,785 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Link cookie to proper domain by referencing web.config & Save

I need to "tie together the cookie with the domain" by referencing the
information from my web.config below in my login's codebhind. I don't
understand how. I need to also save that after doing so:

<add key="cookieDoma inName" value=".test.co m" />

<authenticati on mode="Forms">
<forms loginUrl="login .aspx" name="CH.COM.AU TH" path="/"/>
</authentication>

something like this:
HttpContext.Cur rent.Applicatio n.GetKey(cookie DomainName);
then tie the cookie to the form name?

Here's the skeleton of our login.aspx.cs:

public partial class login : Web.BasePage
{
protected void Login1_LoggedIn (object sender, EventArgs e)
{
Login login = (Login)LoginVie w1.FindControl( "Login1");

CMembershipUser user =
(CMembershipUse r)Membership.Ge tUser(login.Use rName);
ProfileCommon profile = Profile.GetProf ile(login.UserN ame);
profile.User.CU serID = user.CUserID.To String();
profile.Save();

HttpContext.Cur rent.Applicatio n.GetKey(cookie DomainName); <<---my
attempt here to start relating the cookie to the domain...this is probably
incorrect.
}

}

I'm completely lost. I know this is simple but I haven't done much with
cookies in .NET 2.0. We are using the membership api in 2.0
--
dba123
Aug 18 '06 #1
0 1259

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1538
by: Fred | last post by:
I've check all the info I can find on cookies and I have gotten some idea of how to set a cookie, set the expiration, and get the cookie value. But I need help bringing it all together to accomplish what I need to do. When someone first visits a signup page, I want them to see a popup that says they can sign up within the next 30 days without having to pay an appication fee. Then each time they revisit over the next 30
5
3314
by: brettr | last post by:
When I reference document.cookie, there is a long string of key=value; pairs listed. I may have 100 hundred cookies on my hard drive. However, most only have one key=value pair. Does the document.cookie variable combine all cookie key=value pairs? All of the examples I've seen discuss referencing a specific cookie. I don't see how this is done. Cookies are usually named by the domain. If I want to reference a specific cookie, do I...
0
1568
by: vMike | last post by:
I don't know if I can explain this here, but I will try. I am using WebRequest/WebResponse to get product information from another website then put the selections in a shopping cart of the remote site. (So that I can tract what is purchased) I all works fine until checkout time because at check out time I have to use a Response.Redirect and I need to pass the cookies and the processing onto the remote server. I don't want to handle the...
3
2559
by: Martin | last post by:
I'm plannig an asp.net web farm. I expect to use a SQL database for session state management, ie. <sessionState mode="SQLServer" cookieless="false" .../> My application uses web forms authentication, with a secure cookie, ie. <authentication mode="Forms"> <forms name="mycookie" loginUrl=https://secure.domain.com requireSSL="true"/> </authentication>
3
11124
by: Wysiwyg | last post by:
After a server created cookie is processed on the client I want it removed, cleared, or expired in the javascript block but have been unable to do this. If I set a cookie value in the server code behind and don't use a domain then I can not change or remove that cookie's value on the client. If I subsequently create the cookie again in the codebehind then I actually end up with TWO cookies with the same name in the response. The cookie...
17
4182
by: Bruno | last post by:
I have a feature that is hosted on a different domain from the primary one in a frame, and need to retain values in a cookie. example: A web page at one.com contains a frame which has a page hosted at two.com If I view the frameset from one.com in Firefox, all works well with the content from two.com. But if trying to view this using IE (with standard security settings), the cookie set by two.com is not accessible.
6
2702
by: kelvlam | last post by:
Hello all, I'm still a bit new with JavaScript, and I hope the guru here can shed some light for me. It's regarding handling cookie and the case-sensitive nature of JavaScript itself. My problem is how do I handle the "path" parameter in cookie. First, the sequence start at http://www.testServer1.com/TestApp/page1.htm, and a cookie is set at
5
2226
by: SJ | last post by:
Hi, In my website, i have a cookie that allows the user to remain logged in for upto 90days. So I'm setting the cookie expiration time to 90 days in the future from the time the user logs in. I've been testing my code and for some reason, the cookie expires randomly before even 24 hrs has passed. Yesterday it expired after 11hrs and 20mins. Any idea why my cookie expiration isn't working?
2
2854
by: kelly.pearson | last post by:
Is this a bug? I am trying to write a cookie that can be accessed by various .Net applications on our domain. However, whenever I add the domain property to the cookie, no errors get thrown but the cookie doesn't get written. I am trying this from my localhost using vs2003, .net framework 1.1, windows xp prof. Sample code I am testing with is below. Public Class WebForm1 Inherits System.Web.UI.Page
0
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9957
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8983
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7505
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5518
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.