Project

General

Profile

Actions

Bug #1722

closed
ЕИ

WApplication::setCookie() Bug?

Bug #1722: WApplication::setCookie() Bug?

Added by Евгений Илюшин over 13 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
02/27/2013
Due date:
% Done:

0%

Estimated time:

Description

Hi.
After update 26.02.2013 in my programm i can't seem to set a cookie.

setCookie("terminal",m_termId,--1);
const std::string *isTerminal = environment().getCookieValue("terminal");
if(isTerminal)
log("info")<<"term id is "<< *isTerminal;
print result "term id is ''"

Before update it worked.
I clear all cookies in chrome, it not helped me :(

WD Updated by Wim Dumon over 13 years ago Actions #1

Hello,

The environment is read-only and static. It is created when the session is started. So if you set a cookie, it's only the next time you start a session that the environment object will contain the cookie.

Wim.

ЕИ Updated by Евгений Илюшин over 13 years ago Actions #2

Hello!
How i can save user settings ?
If i set user setting in to cookies, but after press F5 all settings is cleared.

WD Updated by Wim Dumon over 13 years ago Actions #3

Can you post a complete test-case that demonstrates this? E.g. a modified hello world that sets&reads a cookie showing that it fails.

BR,
Wim.

ЕИ Updated by Евгений Илюшин over 13 years ago Actions #4

I solved the problem.
I have proved wrong the lifetime of cookies.
In setCookie("terminal",m_termId,--1); no need to set the value as (--1).
After set time value like 86400*365 all it worked.

Now i have a question. How can sets value to all life ?

WD Updated by Wim Dumon over 13 years ago Actions #5

  • Status changed from New to Resolved

KD Updated by Koen Deforche over 13 years ago Actions #6

  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom