Hie....my set_cookie function is not working. I dont know why it is happening as there is no error also...i am setting it through javascript....... -
var live_element;
-
function fokus(ele,path)
-
{
-
//alert(ele);alert(path);return false;
-
live_element = ele;
-
//alert(live_element.id); //LIKE C_NAME
-
-
if(Get_Cookie('live_element')) //Go to 873
-
{
-
Delete_Cookie( 'live_element');
-
}
-
Set_Cookie( 'live_element', live_element.id,'',path,'','' );
-
//Set_Cookie( name, value, expires, path, domain, secure )
-
}
-
-
function Set_Cookie( name, value, expires, path, domain, secure )
-
{
-
-
// set time, it's in milliseconds
-
var today = new Date();
-
today.setTime( today.getTime() );
-
-
/*
-
if the expires variable is set, make the correct
-
expires time, the current script below will set
-
it for x number of days, to make it for hours,
-
delete * 24, for minutes, delete * 60 * 24
-
*/
-
if ( expires )
-
{
-
expires = expires * 1000 * 60 * 60 * 24;
-
}
-
var expires_date = new Date( today.getTime() + (expires) );
-
-
document.cookie = name + "=" +escape( value ) +
-
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
-
( ( path ) ? ";path=" + path : "" ) +
-
( ( domain ) ? ";domain=" + domain : "" ) +
-
( ( secure ) ? ";secure" : "" );
-
-
}
-
Here , the 'live_element' named cookie is not generated...what could be the problem?
2 2330 gits 5,390
Recognized Expert Moderator Expert
when you pass '' as the expires param then your function will produce an invalid date for expires_date ... you could fix that with an adapted condition: - if ( expires ) {
-
expires = expires * 1000 * 60 * 60 * 24;
-
} else {
-
expires = 0;
-
}
-
kind regards
yap.....i'll try this one and see.....
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: amit kumar |
last post by:
I am calling a function which returns pointer to a map.
The declaration of the map is map<int,vectxyz*>. vectxyz is a vector
containing pointer to a class xyz.
For map<int,vectxyz*>* p1
In the...
|
by: Randell D. |
last post by:
Folks,
I'm sure this can be done legally, and not thru tricks of the trade - I
hope someone can help.
I'm writing a 'tool' (a function) which can be used generically in any
of my projects. ...
|
by: Julie May |
last post by:
I have 90% of my function working and I know to get the next 10% it is justa matter of getting the quotations and the escaping quotations correct. Here is the portion that does work:
<working...
|
by: serkan |
last post by:
Guys,
I am trying to get this password reset functionality wor for me but I am not successful at all. Please somebody help me. I get "Your password could not be reset - please try again later" so I...
|
by: den2005 |
last post by:
Hi everybody,
I am confused and still looking why this codes is not working. Can anyone notice or know why this code is not working? Thanks in advance.
Code working:
<form id="form1"...
| |
by: SQACPP |
last post by:
Hi,
I try to figure out how to use Callback procedure in a C++ form
project
The following code *work* perfectly on a console project
#include "Windows.h"
BOOL CALLBACK...
|
by: BibhuAshish |
last post by:
Hello guys
i have one function which converts the ip/netmask into networkid/netmask and also it shows the message to user that his ip is changed to network id. but that function is working in...
|
by: =?Utf-8?B?SmVycnkgQw==?= |
last post by:
I am using this code to get groups for a user and getting a error (5) on the
GetAuthorizationGroups() function .
There are two domains.
This function works on the local domain but does not work...
|
by: über |
last post by:
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Cookies;
use strict;
my $ua = LWP::UserAgent->new();
my $cookie_jar = HTTP::Cookies->new();
$ua->cookie_jar( $cookie_jar );...
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
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 ...
| |
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...
| |