473,657 Members | 2,486 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unable to read cookie value

4 New Member
Hi,

I am unable to read a cookie value from the cookies. i have set cookie value from javascript in scripting side and try to read cookie value from coding part ie. default.aspx.vb . i have shown my javascript page below:
Expand|Select|Wrap|Line Numbers
  1. <pre lang="cs">function setcookie()
  2.    {
  3.    var today=new Date();
  4.    var expire=new Date();
  5.    var ndays;
  6.    if(ndays==null || ndays==0)ndays=1;
  7.    expire.setTime(today.getTime() + 3600000*24*nDays);
  8. document.cookie = "hostname"+"="+VIH_HostName+ ";expires=&"+expire.toGMTString();
  9. alert(VIH_HostName)
  10. }</pre>
this function called from onload in body tag.

here is my vb code to read cookie value
Expand|Select|Wrap|Line Numbers
  1. <pre lang="vb">If Not Request.Cookies("hostname") Is Nothing Then
  2.                            count = Request.Cookies("hostname").Value
  3.                            Response.Write("cookie: " & count)
  4.                      End If</pre>

If I read the cookie I get only null string.. anyone help me to resolve this problem..

regards
Sasikumar
Nov 11 '10 #1
2 2507
Frinavale
9,735 Recognized Expert Moderator Expert
I don't see any JavaScript code posted.
I see something that looks like JavaScript but... it isn't valid and it isn't within <script type="javascrip t"> tags.

Are you seeing JavaScript errors in your browser?
Nov 12 '10 #2
ramuksasi
4 New Member
No i am not see the javascript errors but i need the to pass value from javascript which is placed in asp source code side to coding part ie default.aspx.vb ..
Nov 13 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
10967
by: | last post by:
How does one read and write the cookie expiration date. At the moment my code is returning a value BUT a garbled value: '//Write cookie... Response.Cookies("Propsect").Expires = Date() + 1 '//Read cookie... ExpDate = Request.cookies("Propsect") Response.write "Prospect expiry date: " & expDate & "<br>"
2
1859
by: terry | last post by:
Hi, When I store cookie value "12:05:33" and read it again, I find the value become "12%3A05%3A33", how to read or convert it correctly? Thanks!
0
1226
by: Kevin | last post by:
Hello, all experts: May I ask you some questions? First, i'm programming a software of auto-authentication by using VB.NET tool. This software's functions is similar to do the account login through browser. I meet some questions when I post data to authentication page. I have tested the authentication webpages of Gemtek G-6000 and Cipherium bonalinx-W 1300 separately. Authentication succeeds for Gemtek, unsuccessful for Cipherium. I...
0
1457
by: anibakore | last post by:
Hi All, I am using product.xml for vs2005 pre-requisites. I am using <RegistryCheckinside <InstallCheck>. I am trying to read one registry value of installed software. I can see it through regedit. I have logged in as administrator. But, in the log file I could see following error Unable to read registry value
3
2569
by: korque | last post by:
Hi I'm gathering information from web page, first I get headers and store recieved cookies then I get source with file()-function. Is there easy way to send cookie value back to host on each page, so my script would be recognized as web browser and sessid wouldn't change on every page ?
1
1567
by: ricknew | last post by:
Hi Folks, We are setting cookies on our site so anonymous visitors can save items for a quote: The cookies are set as follows: GUID = System.Guid.NewGuid().ToString(); FormsAuthenticationTicket newTicket = new FormsAuthenticationTicket( 1, GUID,
1
9919
by: rajunarender01 | last post by:
hi i am working with the usercontrol and want to update the cookie value in the user control how to do it
0
1675
by: javaBookWorm | last post by:
203.114.10.66 - - "GET /stat.gif?stat=v&c=F-Secure&v=1.1%20Build%2014231&s=av%7BNorton%20360%20%28Symantec%20Corporation%29+69%3B%7Dsw%7BNorton%20360%20%28Symantec%20Corporation%29+69%3B%7Dfw%7BNorton%20360%20%28Symantec%20Corporation%29+5%3B%7Dv%7BMicrosoft%20Windows%20XP+insecure%3BMicrosoft%20Windows%20XP%20Professional+f%3B26027%3B26447%3B26003%3B22452%3B%7D&r=0.9496 HTTP/1.1" 200 43...
3
2586
by: webster5u | last post by:
Miss/Mr. Programmer, I have a idea to remove the cookie value from a website after all browser closed. It is like session kept in server and eliminate after all browser closed. My purpose is reducing browsing security issue through minimize the data resident in the cookie. The reason i using the cookie instead of session because I used cookie in applying SSO (Single Sign On) for different web application server instead of single server. ...
0
8392
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
8305
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
8823
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...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7320
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
5632
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
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
1944
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.