Atozed Forums

Full Version: Problems with cookies in IW15
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I have a well working application in IntraWeb 5.2.26 in Indy-mode and I uses cookies to remember login information. This works perfect for me on my computers.

But for some of my customers the "remember me"-function doesn't work. 

I have the following CookieOptions:

CookieNameSuffix: "empty"
HttpOnly: False
SameSite: ssoLax
Secure: False
SessionCookies: True
UseCookies: True 


I can't find any reason for this, it makes no sense. Any idears of what could be wrong?

Best Regards
Per
Can you please show the code used to set the cookie information?
Save:
UserSession.CookiePut( 'BizPointUser', Anvandare );
UserSession.CookiePut( 'BizPointPassword', Losen );

Load:
if UserSession.CookieExists( 'BizPointUser' ) then
  begin
    Anvandare := Usersession.CookieGet( 'BizPointUser' );
    Losen := Usersession.CookieGet( 'BizPointPassword' );
    ...
  end;
Sorry, missed my functions in UserSession:

procedure TIWUserSession.CookieDelete(Namn: string);
begin
Webapplication.Response.Cookies.RemoveCookie( Namn, webapplication.cookiepath );
end;

function TIWUserSession.CookieExists(Namn: string): Boolean;
begin
Result := WebApplication.Request.CookieFields.IndexOfName( Namn ) > -1;
end;

function TIWUserSession.CookieGet(Namn: string): string;
var
V: string;
begin
V := WebApplication.Request.CookieFields.Values[ Namn ];
Result := TNetEncoding.URL.Decode( V );
end;

procedure TIWUserSession.CookiePut(Namn, Value: string);
var
V: string;
begin
V := TNetEncoding.URL.Encode( Value );
Webapplication.Response.Cookies.Add(THttpCookie.create( Namn, V, webapplication.cookiepath, Date + 999, true, true ) );
end;