Overview
Features
Download
Documentation
Community
Add-Ons & Services

httpformserver questions

Please post support and help requests here.

Re: httpformserver questions

Postby rakesh » 27 Apr 2012, 18:52

Look into the browser developer tools window and look for request/response headers. Make sure your browser is sending you the cookie information in the request headers, and also that your server is sending it in the response headers
rakesh
 
Posts: 78
Joined: 13 Apr 2011, 17:43
Location: Chicago

Re: httpformserver questions

Postby Sqarzz » 27 Apr 2012, 20:35

yes, the developer tool was a great suggestion.
The problem was that I had to write to the cookie,
before I called: std::ostream& ostr = response.send(), which sounds logic.

How would a cookie be cleared? Do I just have to write garbage to the cookie, or is there a way to clear them all?
is it safe to just call response.clear()?
Because response.setChunkedTransferEncoding & response.setContentType were previously set.

also: response:clear doesn't work when i have send the cookie in a previous instance of the handler.
Sqarzz
 
Posts: 24
Joined: 09 Apr 2012, 11:11
Location: Belgium

Re: httpformserver questions

Postby rakesh » 27 Apr 2012, 21:08

Server cannot delete a cookie (since it is stored in client browser). The usual way is to set the cookie's expiration time to some time in the past, and the browser will delete its stored cookie
rakesh
 
Posts: 78
Joined: 13 Apr 2011, 17:43
Location: Chicago

Re: httpformserver questions

Postby Sqarzz » 27 Apr 2012, 21:37

thanks you, cookie.setMaxAge(0); indeed worked
Sqarzz
 
Posts: 24
Joined: 09 Apr 2012, 11:11
Location: Belgium

Re: httpformserver questions

Postby Sqarzz » 27 Apr 2012, 22:28

Okay, got my cookies working

In the console, every time a new htmlpage is requested "/favicon.ico" gets outputted.
I tried getting around this by using <link rel="shortcut icon" href="http://localhost/" />, that way, the client browser does not request the favicon.
Only problem now is the backslash still being outputted to the console "/".
Is there a way around this?
Sqarzz
 
Posts: 24
Joined: 09 Apr 2012, 11:11
Location: Belgium

Re: httpformserver questions

Postby Sqarzz » 30 Apr 2012, 19:02

could it be possible the POST of the text/html itself is causing the output of "\" in the console, when /localhost/ is first called?
Sqarzz
 
Posts: 24
Joined: 09 Apr 2012, 11:11
Location: Belgium

Re: httpformserver questions

Postby rakesh » 30 Apr 2012, 22:36

/favicon.ico is something every browser requests - to use as the icon to associate with a bookmark, or as tab icon etc.
rakesh
 
Posts: 78
Joined: 13 Apr 2011, 17:43
Location: Chicago

Previous

Return to Support

Who is online

Users browsing this forum: No registered users and 19 guests

cron