Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PRevenitng a session from being created in OnBeforeDIspatch
Hi Sam,

For others in the future, I'm going to repost some of those responses.  Telegram doesn't "thread" by subject, and search isn't as useful so things like this are much more helpful to note here in the forum.  If I missed part of the conversation, or quoted it incorrectly, please post a response.

Depending on your context, ContentHandlers may be what you are looking for. There are examples in our demos and they are documented on our site.
17 hooks onto 15 using ContentHandlers

I'm trying to avoid doing it with redirecting though - I want the URL to be the same as default, with a different html response.
This is the funcitonality that we had with XI, that I'm trying to recreate

If its on the first page, look at the onnewsession event in SC, it allows you to choose which page is returned for main

OnBeforeDispatch does happen multiple times. Each request/response goes through OnBeforeDispatch. During application start up multiple requests are sent to the server. There is nothing wrong there
If you want to block a request before it creates a new session IW 15 gives you the OnBeforeNewSession event
TOnBeforeNewSessionEvent = procedure(const aUrlPath: string; aRequest: THttpRequest; out vCanCreate: Boolean) of object;
Just set vCanCreate to false and the user will get a 404 and no session will be created

Messages In This Thread
RE: PRevenitng a session from being created in OnBeforeDIspatch - by DanBarclay - 10-18-2019, 06:24 PM

Forum Jump:

Users browsing this thread: 2 Guest(s)