Bug #1722
closedWApplication::setCookie() Bug?
0%
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 :(
Updated by Wim Dumon about 12 years ago
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 Евгений Илюшин about 12 years ago
Hello!
How i can save user settings ?
If i set user setting in to cookies, but after press F5 all settings is cleared.
Updated by Wim Dumon about 12 years ago
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 Евгений Илюшин about 12 years ago
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 ?
Updated by Wim Dumon about 12 years ago
- Status changed from New to Resolved
http://stackoverflow.com/questions/3290424/set-a-cookie-to-never-expire
The RFC does not allow this.
BR,
Wim.
Updated by Koen Deforche about 12 years ago
- Status changed from Resolved to Closed