Do not use on any
shared computer
August 29, 2008 10:11pm pdt
 
[x]
Attachment Details

Cookie creation problem.

Tags: VB
Hello all,

I have the following code on my login button on click event in my asp.net 2.0 application to create a cookie. However once the login is complete I can not get the label boxes on my master page to show the data from the cookie and can not find the cookie in the C:\Documents and Setttings\%user profile%\cookies folder. I have included both the onclick code and the code on the master page on load event. Any help you can give me would be great.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
---- Loging Button on click ---
 
If DBConnection(txtuserid.Text.Trim(), txtpassword.Text.Trim()) Then
                Session("Logged_IN") = "Yes"    '   |||||   Use to Validate on other pages in the application                
                Dim aCookie As New HttpCookie("fud_info")
                aCookie.Values("userid") = "John Doe"
                aCookie.Values("lastVisit") = DateTime.Now.ToString()
                aCookie.Expires = DateTime.Now.AddHours(4)
                Response.Cookies.Add(aCookie)
                Response.Redirect("default.aspx")
 
---- master file on load event ----
 
Dim dtNow As DateTime = DateTime.Now
Dim currentdt As Label
currentdt.Text = dtNow
Dim userid As Label
Dim lastvisited As Label
userid.Text = Request.Cookies("fud_info")("userid")
lastvisited.Text = Request.Cookies("fud_info")("lastVisit")
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: woodje
Question Asked On: 06.23.2008
Participating Experts: 1
Points: 500
Views: 0
Translate:
Loading Advertisement...
 
[+][-]Expert Comment by G0ggy

Rank: Guru

Expert Comment by G0ggy:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by woodje
Author Comment by woodje:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628