Project

General

Profile

Actions

Bug #1722

closed

WApplication::setCookie() Bug?

Added by Евгений Илюшин about 12 years ago. Updated about 12 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 :(

Actions #1

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.

Actions #2

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.

Actions #3

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.

Actions #4

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 ?

Actions #5

Updated by Wim Dumon about 12 years ago

  • Status changed from New to Resolved
Actions #6

Updated by Koen Deforche about 12 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF