473,761 Members | 9,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Could someone test this? It's driving me crazy.

Hello,

I have this code in Global.asax:

Sub Session_Start(S ender As Object, E As EventArgs)

Dim cookie As HttpCookie = Request.Cookies ("MyCookie")
If Not cookie Is Nothing Then
Response.Write( " * Cookie Exists * ")
If Not cookie.Values(" culture") Is Nothing
Response.Write( " * Value Culture Exists Inside Cookie *
")
Session("cultur e") = cookie.Values(" culture")
Thread.CurrentT hread.CurrentCu lture = New
CultureInfo(coo kie.Values("cul ture"))
Else
Response.Write( " * Value Culture Doesn't Exist Inside
Cookie* ")
cookie.Values.A dd("culture", "pt-PT")
Response.Cookie s.Add(cookie)
End If
Else
Response.Write( " * Cookie Doesn't Exist * ")
Dim newCookie As HttpCookie = New
HttpCookie("Cam araDosPares")
newCookie.Value s.Add("culture" , "pt-PT")
newCookie.Expir es = #01/01/3000#
Request.Cookies .Add(newCookie)
End If

End Sub

Basicly this shoud work this way:

IF Cookie Exists AND Cookie Value "Culture" Exists THEN

Session("cultur e") = ...

IF Cookie Exists AND Cookie Value "Culture" Doesn't Exist THEN

Add Culture Value to the existing Cookie.
(NOTE: Cookie have many other values. Culture Values must be
added to the existing ones.)

IF Cookie Doesn't Exist THEN

Create Cookie and place a "culture" value inside it.
Of course I want this code to run when a new session starts.

The code works but strange things happen like:
No Cookie is created.
OR
When Culture value is added to cookie all the other disappear.

This is driving me crazy. I am on this for hours.
Could someone please check it out?
I added Response.Write commands to help following what is going on.

Maybe something stange going on with my OS....I don't know.

Thank You,
Miguel

Nov 19 '05 #1
0 1310

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

Similar topics

0
1450
by: RoyalDutchman | last post by:
I want to quickly test XALAN to create a fo-file for later use in fop but can't find any decent xml-file with an xsl-fo file based on the xml file and which doesn't give me errors in xalan. Can anyone point me to the right website to get these 2 files and which actually work!? I tried making an xsl-fo file myself but it keeps giving me errors and it's driving me crazy.. Argh.. RD
15
4952
by: John Cassidy | last post by:
This has been driving me crazy. I've done basic C in school, but my education is mainly based on object oriented design theory where Java is our tool. For some reason, while helping a friend with a C Programming lab. I cannot for the life of me generate a random number. i don't know what is wrong. please help. #include <stdio.h> #include <stdlib.h> #include <math.h>
6
2647
by: ypjofficial | last post by:
HI, I have following terrific confusion. class test { public: int i; int * j; int **k;
1
1612
by: Miguel Dias Moura | last post by:
Hello, I have been trying, for days, to retrieve a control's ClientId in a javascript function. I am using a master page and this is why I need to retrieve the Control's ClientId. The control Id is "Panel1". I placed "<%=Panel1.ClientID %>" in my HTML code and I got "ctl00_pPanel1". In my Javascript function I am using:
2
12637
by: richard | last post by:
This error is driving me crazy. Everytime I try to compile a DLL, I get this error: "Could not execute CVTRES.EXE." 1) Last week the compile worked 2) I have uninstalled and reinstalled Framework 2 and VS2005 3) I have copied cvtres.exe files from other computers which do compile to this computer. 4) I have deleted all copies of the DLL in question from my computer
6
2218
by: thomas.luce | last post by:
Okay, I have been programming for a long time, and am getting back into C after about a 4 year break from it. Below is some code that won't compile for the life of me, and it is driving me crazy! If anyone can see anything that I can't, I would love to know. All the code is pasted, although in my real code it is broken into a header and a seperate .c file. #include <stdlib.h> typedef enum {typeNum, typeString} VariableType;
7
12593
by: gretean | last post by:
I have a problem that's driving me crazy involving Microsoft's ability to deduce template parameters. I am using Visual Studio .NET (aka VC7?), and it gives an error compiling the following code. template <int x, int yclass M { public: template <int xRet, int yRet, int xR, int yR> M<xRet, yRetoperator *(const M<xR, yR&b) const { M<xRet,yReta; return a;
6
1277
by: stork | last post by:
C++ is always evolving. Within C++, there tend to be two communities. There is the community pushing for performance features, getting ever closer to the metal, and then, there is the applications community. The applications community would, in general, prefer C++ to become more high level - adding things like garbage collectors, improved pointer safety, in short, to be a language useful for building applications that now go to the...
5
1770
by: mark4asp | last post by:
Every time the function below is called I get the alert. So I put a deliberate error in there and I check the value of (reportType=='MANDATE') in Firebug, which is found to be true. But still the alert comes up. Why? I checked the following watch expressions at the blah blah point. id = 5843 reportType = "MANDATE"
0
9531
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
9345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10115
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9775
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
8780
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...
0
6609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5229
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...
1
3881
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
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.