473,783 Members | 2,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Na vigate2(), 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 4124
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.co m

"pgmanno" <pg*****@gmail. com> wrote in message
news:11******** **************@ t31g2000cwb.goo glegroups.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.Na vigate2(), 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.co m

"pgmanno" <pg*****@gmail. com> wrote in message
news:11******** **************@ z34g2000cwc.goo glegroups.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
3591
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 session functionality... <?php session_start(); session_register; $my_var = "whatever";
0
1391
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
2457
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 variables and all of them are being stored into session and accessed from session and individual session object. Example: Session = "XYZ", Session=100, Session="NAME", etc.
2
2187
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 relevant criteria ? is the primary criteria max expected total storage size (for all active sessions) versus max ram available on the state-server machine ? if ADO.NET objects (such as small DataTables) must be stored in session-state , is any...
1
1810
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 information about the web pages, and the Session and cookies will be alive for as long as I'm posting back to the web site. Boy was I wrong! The website (not mine btw) uses a combination of session variables and
18
3445
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 File-New-Window creates an instance of IE in the same process with the same SessionID as the parent window is in big trouble. This fundamentally restricts the usefullness of using session state management. I probably missed it somewhere - can...
5
2478
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 session data and possibly hijack a session. I've got no clue how to use a table for session management. I've started off by creating a table that will store the following: Session ID (will create this using dechex with a random number)...
0
1152
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 some post message to corresponding URL.Then I will get response string. In response string i am go to create one .HTML extension file.Then I am using AxWebBrowser Class Create Object .Then I am using this object ...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10083
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.