473,395 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Session management with AxWebBrowser

Hello all,

Here is my question. I have an AxWebBrowser (hereafter refered to as
"Browser") control framed in a smart client. The smart client requires
logon, and the web app that the Browser is pointing to requires logon
and is using Forms Authentication. I have set up a web service so that
when the user logs on to the smart client, s/he can also log on to the
website (basically, the username/password is passed up, auth ticket set
and a session is established using cookies and the Browser uses those
cookies from that point forward).

My problem is that I want the Browser to be able to gracefully recover
from session expiration. Meaning, I do not EVER want to frame the
website logon page in the Browser, I always want it to be authenticated
from behind the scenes. The mechanism I used initially was creating my
own control that has an instance of a Browser, exposing a Navigate
method in that control which calls AxWebBrowser.Navigate2(), creating
another web service which returns a boolean indicating whether or not
the session is still alive, and on every call to Navigate, checking the
service and re-logging in if the session is not alive. That works just
fine as long as the Navigate method is called on my new control;
however, if the browser is visible, the session expires, and a link is
clicked, the code in the Navigate method is not called, and the Browser
redirects to the login page (since the session has expired). I though
about setting a windows hook to capture left click events and if the
browser is visible, go through the "check session" logic, but that
seems a bit like overkill. Anyone have any ideas how to handle this
issue?

Thanks,
pgm.

Mar 31 '06 #1
4 4103
pgm,

Instead of checking to see if the session is still alive, why not expose
a no-op on the service side which will keep the session alive? Then, behind
the scenes, your app can make calls to this no-op every few minutes or so
(some value before the session timeout).

This will also make it easier to program on the service side, since you
don't have to worry about the sessions being dropped, you can assume that it
is one continuous session.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"pgmanno" <pg*****@gmail.com> wrote in message
news:11**********************@t31g2000cwb.googlegr oups.com...
Hello all,

Here is my question. I have an AxWebBrowser (hereafter refered to as
"Browser") control framed in a smart client. The smart client requires
logon, and the web app that the Browser is pointing to requires logon
and is using Forms Authentication. I have set up a web service so that
when the user logs on to the smart client, s/he can also log on to the
website (basically, the username/password is passed up, auth ticket set
and a session is established using cookies and the Browser uses those
cookies from that point forward).

My problem is that I want the Browser to be able to gracefully recover
from session expiration. Meaning, I do not EVER want to frame the
website logon page in the Browser, I always want it to be authenticated
from behind the scenes. The mechanism I used initially was creating my
own control that has an instance of a Browser, exposing a Navigate
method in that control which calls AxWebBrowser.Navigate2(), creating
another web service which returns a boolean indicating whether or not
the session is still alive, and on every call to Navigate, checking the
service and re-logging in if the session is not alive. That works just
fine as long as the Navigate method is called on my new control;
however, if the browser is visible, the session expires, and a link is
clicked, the code in the Navigate method is not called, and the Browser
redirects to the login page (since the session has expired). I though
about setting a windows hook to capture left click events and if the
browser is visible, go through the "check session" logic, but that
seems a bit like overkill. Anyone have any ideas how to handle this
issue?

Thanks,
pgm.

Apr 1 '06 #2
Hi Nicholas,

Yeah, I thought of that, but it does not solve the problem of the web
app being restarted. I want it so that even if the app is redeployed,
the user will not be redirected to the login page.

Apr 2 '06 #3
Hmm, why not create a cookie with a valid login which doesn't expire?
Then, have the website check for the cookie? This way, it will always be
passed to the website, and then you don't have to worry about app restarts.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"pgmanno" <pg*****@gmail.com> wrote in message
news:11**********************@z34g2000cwc.googlegr oups.com...
Hi Nicholas,

Yeah, I thought of that, but it does not solve the problem of the web
app being restarted. I want it so that even if the app is redeployed,
the user will not be redirected to the login page.

Apr 2 '06 #4
Can't do that since multiple different people may use the same computer
at different times.

Apr 3 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Erik Johnson | last post by:
There are a lot of things about PHP I was not too keen on and hence why my company is primarily doing Python these days, but one thing I was quite impressed with was the ease with which it provided...
0
by: Alfredo Delgadillo | last post by:
I'm using AxWebBrowser COM Object to show HTML and ASP pages, but when I open popup forms with java scripts, the session is lost. How can I get it to keep the session?
5
by: Abhilash.k.m | last post by:
This is regarding the session management using Out of proc session management(SQL SERVER). Among the samples below which one is better to set the session? 1. There are 20 session...
2
by: John A Grandy | last post by:
for high traffic public websites , what are the proven options for session-state storage & management ? is an out-of-process state-server generally preferred over a sql-server ? what are the...
1
by: Manuel | last post by:
I thought this would be simple: In my VB.NET application, make and instance of a web control, post a username/password to a website, keep "browsing" the website with the control, extracting...
18
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that...
5
by: rug | last post by:
Hello, I want to use a MySQL Heap table (server load isn't an issue) for session management considering that I use a shared server and don't want anyone who has access to /tmp to be able to read...
0
by: thirunavukarasukm | last post by:
Hai. I created one windows application.I am add reference control to add Microsoft WebBrowser Control..In my application I am using HTTPWebRequest and HttpWebResponse class .To request...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.