473,385 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to retrieve cookies ?

i have written following code for setting & retrieving cookies:-

Expand|Select|Wrap|Line Numbers
  1. $lang = 'french';
  2. setcookie('TRADE_LANGUAGE', $lang, time()+3600);
  3. print_r($_COOKIE);
but while printing it gives only one that is "Array ( [PHPSESSID] => 3p4l3oq93b5tet0r7lea77tca0 ) "

i have checked in my browser 2 cookies are been created PHPSESSID & TRADE_LANGUAGE but while printing only one gets printed,

can someone pls tell what can be issue?

Thanks,
nishika
Feb 2 '10 #1
2 1822
dgreenhouse
250 Expert 100+
The cookie is not going to show up until the second visit to a page on the site.

In other words...

1- On page one a cookie is set
2- The user navigates to a different (or same page)
3- The cookie that was set on the first visit is now available

The reason that your PHPSESSID cookie was available is because it was already set.

It can get more involved than that, but these are the basics.

3.2 How does a cookie really work?
Feb 2 '10 #2
Thanks for response i got the answer
i reloaded the page so i can use the set cookie :)
Feb 2 '10 #3

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

Similar topics

5
by: David Rasmussen | last post by:
Some sites seem to be session driven in the sense that if I visit the homepage and do a few clicks I can navigate anywhere I want, but if I paste the current location into a new browser window...
9
by: Colin Graham | last post by:
hi folks, just wonder if this is possible or is there a better way of doing this. i need to store values in cookies between two forms. the details are added in a popup when this is closed the...
3
by: James Geurts | last post by:
This is probably more of an ASP.Net situation rather than c#, but since all of my code behind is in c#, maybe it fits here. I'm wondering, generally, at what point is it too inefficient to store...
2
by: Jim | last post by:
Hi, I'm working on an intranet site for a large client who has a search routine that runs on another intranet site on a different server. This search routine saves its searches in cookies for...
1
by: onceuponapriori | last post by:
Greetings gents. I'm a Railser working on a django app that needs to do some scraping to gather its data. I need to programatically access a site that requires a username and password. Once I...
4
by: Jeff | last post by:
hey ASP.NET 2.0 I'm preparing for a certification exam on asp.net 2.0 and yesterday I took a skill assessment test on microsoft.com. One of the questions was about creating cookies. This was...
1
by: GpOscar | last post by:
Hey whats up.. i have created a form which does calculations i have installed it on the server and run on it all the other workstations. Now on this form there are some rates that change...
1
by: yootaeho | last post by:
Hi, I have the following script <%@LANGUAGE=Javascript%> <% var myClass = new LoginInfo(); myClass.sessionID = "1321312131"; Response.Cookies("testingCookies") = myClass; var...
2
by: Josh T | last post by:
As of now I am setting a cookie on my aspx page via javascript, function SetCookie(cookieName, value, minutesToExpire) { ClearCookie(cookieName); var expireDate = new Date(); var...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.