Problems with cookies in IW15

<< Click to Display Table of Contents >>

Navigation:  Forum >

Problems with cookies in IW15

Forum link

 


 

01-18-2022, 08:39 AM:

 

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

 


 

01-19-2022, 12:28 AM:

 

Can you please show the code used to set the cookie information?

 


 

02-04-2022, 12:37 PM:

 

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;

 


 

02-11-2022, 10:33 AM:

 

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;