Sessions and Redirecting

Hi, I'm new to intraweb programming and have been trying to find information 
on how to redirect a user to a specific page if a particular session 
variable is not set. So if a user tries to access the IntraWeb site and has 
not logged in, it should redirect them to the login page.

Thanks,

Johann
0
Johann
9/9/2008 4:25:29 PM
embarcadero.delphi.intraweb 3901 articles. 1 followers. Follow

8 Replies
599 Views

Similar Articles

[PageSpeed] 31

What is the source of the page? A html file? or an IW Form? or something 
else.

-- 
Chad Z. Hower a.k.a. Kudzu
http://www.KudzuWorld.com
"Programming is an art form that fights back"
"Johann Campbell" <johann_dot_campbell@no_spam.com> wrote in message 
news:12593@forums.codegear.com...
> Hi, I'm new to intraweb programming and have been trying to find 
> information
> on how to redirect a user to a specific page if a particular session
> variable is not set. So if a user tries to access the IntraWeb site and 
> has
> not logged in, it should redirect them to the login page.
>
> Thanks,
>
> Johann
0
Chad
9/10/2008 8:56:45 PM
Thanks for your reply. It's an IW Form.

Johann.

"Chad Hower" <nospam@atozed.com> wrote in message 
news:13562@forums.codegear.com...
> What is the source of the page? A html file? or an IW Form? or something 
> else.
>
> -- 
> Chad Z. Hower a.k.a. Kudzu
> http://www.KudzuWorld.com
> "Programming is an art form that fights back"
> "Johann Campbell" <johann_dot_campbell@no_spam.com> wrote in message 
> news:12593@forums.codegear.com...
>> Hi, I'm new to intraweb programming and have been trying to find 
>> information
>> on how to redirect a user to a specific page if a particular session
>> variable is not set. So if a user tries to access the IntraWeb site and 
>> has
>> not logged in, it should redirect them to the login page.
>>
>> Thanks,
>>
>> Johann
0
Johann
9/10/2008 9:01:00 PM
"Johann Campbell" <johann_dot_campbell@no_spam.com> wrote in message 
news:13568@forums.codegear.com...
> Thanks for your reply. It's an IW Form.

Have you looked at the demos and how they switch between forms? Its pretty 
much like a normal Windows app.

-- 
Chad Z. Hower a.k.a. Kudzu
http://www.KudzuWorld.com
"Programming is an art form that fights back"
0
Chad
9/11/2008 12:24:55 AM
I can switch between forms. What I want to do is to check for a condition 
and then give back a form based on the condition. I am now resorting to 
using the OnBeforeRender event of the ServerController and I am not sure 
that this is the proper use for this event.

Johann.

"Chad Hower" <nospam@atozed.com> wrote in message 
news:13638@forums.codegear.com...
> "Johann Campbell" <johann_dot_campbell@no_spam.com> wrote in message 
> news:13568@forums.codegear.com...
>> Thanks for your reply. It's an IW Form.
>
> Have you looked at the demos and how they switch between forms? Its pretty 
> much like a normal Windows app.
>
> -- 
> Chad Z. Hower a.k.a. Kudzu
> http://www.KudzuWorld.com
> "Programming is an art form that fights back"
0
Johann
9/11/2008 4:43:30 PM
Its not a good way. I think you are thinking too much like a web app. Think 
desktop - how would you do this in a desktop application? You would put your 
code in button clicks etc.. no?

-- 
Chad Z. Hower a.k.a. Kudzu
http://www.KudzuWorld.com
"Programming is an art form that fights back"
"Johann Campbell" <johann_dot_campbell@no_spam.com> wrote in message 
news:14048@forums.codegear.com...
>I can switch between forms. What I want to do is to check for a condition
> and then give back a form based on the condition. I am now resorting to
> using the OnBeforeRender event of the ServerController and I am not sure
> that this is the proper use for this event.
>
> Johann.
>
> "Chad Hower" <nospam@atozed.com> wrote in message
> news:13638@forums.codegear.com...
>> "Johann Campbell" <johann_dot_campbell@no_spam.com> wrote in message
>> news:13568@forums.codegear.com...
>>> Thanks for your reply. It's an IW Form.
>>
>> Have you looked at the demos and how they switch between forms? Its 
>> pretty
>> much like a normal Windows app.
>>
>> -- 
>> Chad Z. Hower a.k.a. Kudzu
>> http://www.KudzuWorld.com
>> "Programming is an art form that fights back"
0
Chad
9/15/2008 1:24:41 PM
I guess I am thinking like a web app. I guess like on Facebook, if you try 
to access certain pages without logging in, you are redirected to the login 
page. This is what I am trying to achieve. I guess in a desktop app, you 
can't call a form directly and you usually authenticate from the application 
is launched.

One quick question however, what is the documented purpose of the 
OnBeforeRender event?

Thanks,

Johann


"Chad Hower" <nospam@atozed.com> wrote in message 
news:15719@forums.codegear.com...
> Its not a good way. I think you are thinking too much like a web app. 
> Think desktop - how would you do this in a desktop application? You would 
> put your code in button clicks etc.. no?
>
> -- 
> Chad Z. Hower a.k.a. Kudzu
> http://www.KudzuWorld.com
> "Programming is an art form that fights back"
> "Johann Campbell" <johann_dot_campbell@no_spam.com> wrote in message 
> news:14048@forums.codegear.com...
>>I can switch between forms. What I want to do is to check for a condition
>> and then give back a form based on the condition. I am now resorting to
>> using the OnBeforeRender event of the ServerController and I am not sure
>> that this is the proper use for this event.
>>
>> Johann.
>>
>> "Chad Hower" <nospam@atozed.com> wrote in message
>> news:13638@forums.codegear.com...
>>> "Johann Campbell" <johann_dot_campbell@no_spam.com> wrote in message
>>> news:13568@forums.codegear.com...
>>>> Thanks for your reply. It's an IW Form.
>>>
>>> Have you looked at the demos and how they switch between forms? Its 
>>> pretty
>>> much like a normal Windows app.
>>>
>>> -- 
>>> Chad Z. Hower a.k.a. Kudzu
>>> http://www.KudzuWorld.com
>>> "Programming is an art form that fights back"
0
Johann
9/15/2008 7:04:36 PM
"Johann Campbell" <johann_dot_campbell@no_spam.com> wrote in message 
news:15946@forums.codegear.com...
>I guess I am thinking like a web app. I guess like on Facebook, if you try
> to access certain pages without logging in, you are redirected to the 
> login
> page. This is what I am trying to achieve. I guess in a desktop app, you
> can't call a form directly and you usually authenticate from the 
> application
> is launched.

How are you defining your entry points? In app mode all entries go through 
OnNewSession which allows you to choose a form.

> One quick question however, what is the documented purpose of the
> OnBeforeRender event?

Its open ended.

-- 
Chad Z. Hower a.k.a. Kudzu
http://www.KudzuWorld.com
"Programming is an art form that fights back"
0
Chad
9/18/2008 10:54:50 PM
I missed the earlier part of this thread but I think I have an app that's 
doing pretty much what you need, Johann.

This application checks for the presence of a specified name/value pair 
(indicating the user has already authenticated) or a specific cookie value 
(also indicating authentication has already happened).  If neither has 
happened, it redirects to another web site where the user can authenticate 
via an already established mechanism.  Basically, we're piggybacking on the 
authentication process of an already existing and deployed web application.

Ray Porter

"Johann Campbell" <johann_dot_campbell@no_spam.com> wrote in message 
news:15946@forums.codegear.com...
>I guess I am thinking like a web app. I guess like on Facebook, if you try
> to access certain pages without logging in, you are redirected to the 
> login
> page. This is what I am trying to achieve. I guess in a desktop app, you
> can't call a form directly and you usually authenticate from the 
> application
> is launched.
>
> One quick question however, what is the documented purpose of the
> OnBeforeRender event?
>
> Thanks,
>
> Johann
>
>
> "Chad Hower" <nospam@atozed.com> wrote in message
> news:15719@forums.codegear.com...
>> Its not a good way. I think you are thinking too much like a web app.
>> Think desktop - how would you do this in a desktop application? You would
>> put your code in button clicks etc.. no?
>>
>> -- 
>> Chad Z. Hower a.k.a. Kudzu
>> http://www.KudzuWorld.com
>> "Programming is an art form that fights back"
>> "Johann Campbell" <johann_dot_campbell@no_spam.com> wrote in message
>> news:14048@forums.codegear.com...
>>>I can switch between forms. What I want to do is to check for a condition
>>> and then give back a form based on the condition. I am now resorting to
>>> using the OnBeforeRender event of the ServerController and I am not sure
>>> that this is the proper use for this event.
>>>
>>> Johann.
>>>
>>> "Chad Hower" <nospam@atozed.com> wrote in message
>>> news:13638@forums.codegear.com...
>>>> "Johann Campbell" <johann_dot_campbell@no_spam.com> wrote in message
>>>> news:13568@forums.codegear.com...
>>>>> Thanks for your reply. It's an IW Form.
>>>>
>>>> Have you looked at the demos and how they switch between forms? Its
>>>> pretty
>>>> much like a normal Windows app.
>>>>
>>>> -- 
>>>> Chad Z. Hower a.k.a. Kudzu
>>>> http://www.KudzuWorld.com
>>>> "Programming is an art form that fights back"
0
Lester
9/21/2008 1:23:03 AM
Reply:

Similar Artilces:

Session-to-session
I must be missing something. I can not get the tabs to come back as they were when a session is ended. On the Main tab, I have "Show my windows and tabs from last time" On the Privacy tab, I have "Always clear my private data" with ONLY Download History, Cache, and Authenticated Sessions selected. When I close a session and then restart Firefox, I only get a single blank tab. -- The Frosted Flake +------------------------ SPAM is for eating ------------------------+ Frosted_Flake wrote: > I must be missing something. I can not get the tabs to come...

Detecting Session Timeout with Redirect (in Base Class) vs FormsAuth Redirect to Login Page
I have a question about how these two methods co-exist together or perhaps interfer with each other?I implemented the article on detecting session timeout and implemented the base class and changed my page inherits statements to the base class and base class then inherits the System.Web.UI.Page.  http://aspalliance.com/520 My base class will detect session timeout and redirect to the default login page and display a friendly msg above the login control that the session timed out. Protected Overloads Overrides Sub OnInit(ByVal e As EventArgs)MyBase.OnInit(e)If Context...

Intraweb 12.1.24 and TimeOutResponse demo from version Intraweb XI in delphi XE2 Update 3
Hello I'm very new in Intraweb and until now everything look fine. I'm looking for dev. tools for new application and I’m now testing IW XII. IW demo XI TimeOutResponse I don't understood very well. What should happen here. After 1 min of idle time after I push button in my browser I should get a Timeout.html page, but this is not happened. Maybe I do something wrong or I don't understand demo. Please give me some hints or correction? Thanks, Simon simon krizaj wrote: > Hello > I'm very new in Intraweb and until now everything look fine. I'...

Redirect on session expiry
Hi,  I am developing an ASP .NET application in which i have a problem regarding redirecting to a page on session expiry. On starting the application the user gets redirected to the login page (say, login.aspx) if he is not logged in. The problem is I have a page (say, sessionExpired.aspx) that I want the user should get redirected to, when the session expires. But this page is NOT the login page. I tried it by using ASP .NET authentication but was unable to do it. Please reply if any one can help Thanks and regards Sandeep   hi sandeep, can you tr...

Redirecting When Session expired.
Dear All, I want to redirect to a another page when the session ends. In global.aspx.vb file I have add the below line of code. Sub Session_End(ByVal sender As Object, ByVal e As EventArgs) ' Fires when the session ends 'Response.Redirect("SessionExpired.aspx") End Sub But it is not redirecting. Any body know why is this and how to overcome this. Hi, you can't do that as Session_End does not fire in the same thread with the user code, it might also be raised when user is not even online anymore. view post 7504Thanks,Teemu Kei...

Redirect a x-session?!?
Hi, is it possible to redirect the x session? So that I can make a remote connect to x screen. Any manuals about this or a HowTo? THX Andre -- geissler ------------------------------------------------------------------------ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On NetWare I do not think this can be done, but you can connect remotely using Remote Manager and view the X session that way. Tunneling X applications via SSH does not seem to work either (at least for me). Good luck. geissler wrote: > Hi, > > is it possible to redire...

Losing Session after redirect.
Hello everyone.   I am having an issue with a piece of code. Everything else on the site works perfect except for this part.Basically, there is a button on a page that says 'Download images', what this does is compress a list of files and then redirects the user to the .zip file. EDIT: The problem I am having is as soon as the 'Download Images' button is clicked and they are prompted to download the file their session is lost. It does not matter if they download the file or not, as soon as the button is hit the file copy process takes at most 10 seconds and then the ...

Redirection after session expiration
Hi i have the following scenario, when the user session expires the application automatically redirects me to the login page, when i log in again, then the aplication redirects me to the last page where i was before the session expired. How can i redirect after log in again to a specific page instead that the application redirects me to the last page where i was??   Thanks Hi, Have you tried the DestinationPageUrl property of the login control (assuming you are using login controls)? Good luck, Jeroen   In fact a use that property of the control, but it only works ...

redirect after setting session
hi, i have a problem using Responce.Redirect("") after i set a session, basicly when it trys to redirect it just hangs then times out. im using the following code: Session.Timeout = 720; Session["mailUser"] = mailUser; Session["mailPass"] = mailPass; POP3.ServerDisconnect(); Response.Redirect("Default.aspx");  iv also tryed REsponce.Redirect"Default.aspx",false) and also tryed using a meta refresh insted of redirect but im still having problems.  thanks, PhillyTidying your code is also known as braking it are you tryin...

session NULL after redirect
Hello, How come that when i do a redirect i loose my session value? ie: session("login_ok") = "true" >>redirect response.write(session("login_ok")) = NULL ?????? See Understanding session state modes + FAQ. A lot of these issues are covered there. If none of them apply to your situation, provide more details about the problem.Milan Negovan [ASP.NET MVP]http://www.AspNetResources.comASP.NET With Emphasis On Web Standards i've read the document but the problem persists .. even when this : <% response.write(Session.sessionid...

Session timeout redirect
  Hi,  How redirect to login page automatically when the session timeout without any user requesting to server? I tried session_onend function and realise it cannot use the redirect method.  Thank you   Normally you cannot as it depends on a  request coming from the browser to the server.Don't forget to click "Mark as Answer" on the post that helped you.This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped. if you are using forms authentication then you can use <forms loginU...

Redirecting after session expires
I have a Redirect in my global.asax session start event, so when a user starts a new session they get redirected to the login page. This redirect interferes with with other functionality. How can I redirect a user back to the login page after they have 1) logged in2) their session expires3) and they click a button or menu?? Without the redirect in the global.asax the user just it just sits on that page when their session expires Thanks If you use Master page then you can check whether the user session is null or not. When it is null redirect them to the login page. Write thi...

session time out redirect
Hi friends. let me ask you the basic one i dont understand where did you capture in web.config. i have login.aspx page and page1.aspx and page2.aspx page. My question is once i login i will wait 1 min and click button in page2.aspx i want to redirect to login.aspx page how to do?? I dont like to catch each and every page  and redirect to login.aspx page i want some alternative way. and i also using Master page also.  i know we will declare in web.config like that <sessionState mode="InProc" timeout="1"/> when session timout i want to redirect to logi...

Session timeout and redirect
Ok, here's the problem: I have a module with a tree menu on it. If you click and option "after a session timeout", when I try to read a variable stored in the SessionState, it gives an exception (null reference). However, if I click an option on nuke's menu, i'm being redirected to the login page. What I intend to do is that the first case also redirects me to the login page. I couldn't find any piece of code inside DNN that points me how to do it. And also can't understand why there's such a different behaviour for the same action. Is there some code I have to add to my module?...

Web resources about - Sessions and Redirecting - embarcadero.delphi.intraweb

Advertise - Redirecting - YouTube
Search Call us: 1-855-500-2756 Get started Overview Why it Works Success Stories Get Started Make Video Ads Resources This page has moved. Redirecting ...

Aboriginal funds need redirecting - report
Aboriginal funds need redirecting - report

Freedom of speech: Redirecting our society to a dangerous course
Freedom of speech: Redirecting our society to a dangerous course

Leaked Federal Government mental health report recommends redirecting $1 billion from acute hospital ...
A report commissioned by the Federal Government recommends redirecting money from acute hospital care to community-based mental health services. ...

Sona talked of redirecting voters to wrong polls, court hears in robocalls trial
Michael Sona was overheard talking about American-style campaign politics to redirect voters to the wrong polling stations in the 2011 federal ...

Unscrupulous website adverts again redirecting some users to App Store from Safari
... granting any kind of permission… In iOS 8 beta 2, Apple supposedly had remedied the issue: “Safari now blocks ads from automatically redirecting ...

Play Store May Be Redirecting Some Search Terms To The Predefined Categories
The user experience on Android is never standing still, which is no more evident than in the Play Store itself. It seems Google may be trying ...

Redirecting...
Please wait — redirecting to new Business page...

Redirecting...
Click here if you are not redirected

Redirecting Financial Flow To Asia Pacific Crucial For Region’s Sustainable Growth
... (UNEP) notes, the Asia Pacific region is home to over half of the world’s population, but much less than half its natural resources. Redirecting ...

Resources last updated: 11/29/2015 4:13:56 PM