Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with cookies in IW15
#1
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
Reply
#2
Can you please show the code used to set the cookie information?
Reply
#3
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;
Reply
#4
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;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)