473,398 Members | 2,525 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,398 software developers and data experts.

How to isolate sessions

Hi,

In my asp.net (C#) application I use javascript(i.e
window.open('/MyApplication/home.aspx?userid=345', '', '')) to open another
copy of my application in a new window.

In global.asax I set a Session["UserId"] based on QueryString["userid"].
Obviously when I open a new window, the original session of the first
calling window changes as well, but I need to be unchanged. How can I
achieve this?
Thanks for your time

Kind Regards
Mehdi

Nov 18 '05 #1
6 2591
window.open or file >> new >> window or target=_blank causes a new instance
of IE which shares the same session as the window from which it was
executed.

if you need it to have a different session, open a new instance of IE... say
using quick lauch browser icon or from you start menu. The instance started
that way will not share the session with the other instances.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Mehdi" <no****@leavemealone.nowhere> wrote in message
news:OM**************@TK2MSFTNGP15.phx.gbl...
Hi,

In my asp.net (C#) application I use javascript(i.e
window.open('/MyApplication/home.aspx?userid=345', '', '')) to open another copy of my application in a new window.

In global.asax I set a Session["UserId"] based on QueryString["userid"].
Obviously when I open a new window, the original session of the first
calling window changes as well, but I need to be unchanged. How can I
achieve this?
Thanks for your time

Kind Regards
Mehdi

Nov 18 '05 #2
Dave,

Thanks for the suggestion but window.open(...) occures when a hyperlink is
clicked. Unfortuntely I can not ask users of my site to open another
instance of their browser and type the whole url in the address bar.

Regards
Mehdi

"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:Oq**************@TK2MSFTNGP09.phx.gbl...
window.open or file >> new >> window or target=_blank causes a new
instance
of IE which shares the same session as the window from which it was
executed.

if you need it to have a different session, open a new instance of IE...
say
using quick lauch browser icon or from you start menu. The instance
started
that way will not share the session with the other instances.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Mehdi" <no****@leavemealone.nowhere> wrote in message
news:OM**************@TK2MSFTNGP15.phx.gbl...
Hi,

In my asp.net (C#) application I use javascript(i.e
window.open('/MyApplication/home.aspx?userid=345', '', '')) to open

another
copy of my application in a new window.

In global.asax I set a Session["UserId"] based on QueryString["userid"].
Obviously when I open a new window, the original session of the first
calling window changes as well, but I need to be unchanged. How can I
achieve this?
Thanks for your time

Kind Regards
Mehdi


Nov 18 '05 #3
okay first why are you passing the value of user id in the query string.
wont a slightly intelligent user be able to log in as someone else just by
randomly changing the value in user id ?

a better way is to just stored it in a ticket. if a new instance sharing the
current session is opened then you dont have a problem cause even that will
share the same session and the user info.

or you can use querystring based session identifier instead of normal cookie
based session.. that way the url itself will contain the session.
--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Mehdi" <no****@leavemealone.nowhere> wrote in message
news:#o**************@TK2MSFTNGP09.phx.gbl...
Dave,

Thanks for the suggestion but window.open(...) occures when a hyperlink is
clicked. Unfortuntely I can not ask users of my site to open another
instance of their browser and type the whole url in the address bar.

Regards
Mehdi

"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:Oq**************@TK2MSFTNGP09.phx.gbl...
window.open or file >> new >> window or target=_blank causes a new
instance
of IE which shares the same session as the window from which it was
executed.

if you need it to have a different session, open a new instance of IE...
say
using quick lauch browser icon or from you start menu. The instance
started
that way will not share the session with the other instances.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Mehdi" <no****@leavemealone.nowhere> wrote in message
news:OM**************@TK2MSFTNGP15.phx.gbl...
Hi,

In my asp.net (C#) application I use javascript(i.e
window.open('/MyApplication/home.aspx?userid=345', '', '')) to open

another
copy of my application in a new window.

In global.asax I set a Session["UserId"] based on QueryString["userid"]. Obviously when I open a new window, the original session of the first
calling window changes as well, but I need to be unchanged. How can I
achieve this?
Thanks for your time

Kind Regards
Mehdi



Nov 18 '05 #4
Dave,
My asp.net application lifecycle:

There are several users with their own profile(e.g. css, page color scheme
etc) to manage their pages. Then they input some data. There is a global
search facility to include all users items. Againts each item in the search
result, there is a hyperlink "Go to sender's page" that opens a new page
using window.open('/MyApplication/home.aspx?userid=345', '', '')) to open
users page which at this point I use the userid to load their profile.
Amending userid in query string will not allow automatic login. They have
to go to login page for this which I user forms authenticaions and tickets.
Basically I examine userid QueryString in Global.asax
Global_PreRequestHandlerExecute to set as session and load users profile.

I know using sessions for this purpose is not a good idea, but I could't
think of any other methodology. i think you can see the problem here as
when the session changes in the new window, it sets the session of the
global search page to a specific user as well!
Thanks for the reply
Regards

Mehdi

"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:eh**************@TK2MSFTNGP11.phx.gbl...
okay first why are you passing the value of user id in the query string.
wont a slightly intelligent user be able to log in as someone else just by
randomly changing the value in user id ?

a better way is to just stored it in a ticket. if a new instance sharing
the
current session is opened then you dont have a problem cause even that
will
share the same session and the user info.

or you can use querystring based session identifier instead of normal
cookie
based session.. that way the url itself will contain the session.
--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Mehdi" <no****@leavemealone.nowhere> wrote in message
news:#o**************@TK2MSFTNGP09.phx.gbl...
Dave,

Thanks for the suggestion but window.open(...) occures when a hyperlink
is
clicked. Unfortuntely I can not ask users of my site to open another
instance of their browser and type the whole url in the address bar.

Regards
Mehdi

"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:Oq**************@TK2MSFTNGP09.phx.gbl...
> window.open or file >> new >> window or target=_blank causes a new
> instance
> of IE which shares the same session as the window from which it was
> executed.
>
> if you need it to have a different session, open a new instance of
> IE...
> say
> using quick lauch browser icon or from you start menu. The instance
> started
> that way will not share the session with the other instances.
>
> --
>
> Regards,
>
> Hermit Dave
> (http://hdave.blogspot.com)
> "Mehdi" <no****@leavemealone.nowhere> wrote in message
> news:OM**************@TK2MSFTNGP15.phx.gbl...
>> Hi,
>>
>> In my asp.net (C#) application I use javascript(i.e
>> window.open('/MyApplication/home.aspx?userid=345', '', '')) to open
> another
>> copy of my application in a new window.
>>
>> In global.asax I set a Session["UserId"] based on QueryString["userid"]. >> Obviously when I open a new window, the original session of the first
>> calling window changes as well, but I need to be unchanged. How can I
>> achieve this?
>>
>>
>> Thanks for your time
>>
>>
>>
>> Kind Regards
>>
>>
>> Mehdi
>>
>>
>>
>
>



Nov 18 '05 #5
well firstly i still dont understand why you need to use this approach.
for a global search i presume you are searching the database and local
folders. why cant you have an access based on roles.
say all users can see the following things from all over users..
make sure the things that can be seen by all users are not bound to a
particular user.. atleast as far as viewing is concerned.. you can always
lock down on others making any modifications allowing only the owner of item
to modify.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Mehdi" <no****@leavemealone.nowhere> wrote in message
news:uG**************@TK2MSFTNGP14.phx.gbl...
Dave,
My asp.net application lifecycle:

There are several users with their own profile(e.g. css, page color scheme
etc) to manage their pages. Then they input some data. There is a global
search facility to include all users items. Againts each item in the search result, there is a hyperlink "Go to sender's page" that opens a new page
using window.open('/MyApplication/home.aspx?userid=345', '', '')) to open
users page which at this point I use the userid to load their profile.
Amending userid in query string will not allow automatic login. They have
to go to login page for this which I user forms authenticaions and tickets. Basically I examine userid QueryString in Global.asax
Global_PreRequestHandlerExecute to set as session and load users profile.

I know using sessions for this purpose is not a good idea, but I could't
think of any other methodology. i think you can see the problem here as
when the session changes in the new window, it sets the session of the
global search page to a specific user as well!
Thanks for the reply
Regards

Mehdi

"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:eh**************@TK2MSFTNGP11.phx.gbl...
okay first why are you passing the value of user id in the query string.
wont a slightly intelligent user be able to log in as someone else just by randomly changing the value in user id ?

a better way is to just stored it in a ticket. if a new instance sharing
the
current session is opened then you dont have a problem cause even that
will
share the same session and the user info.

or you can use querystring based session identifier instead of normal
cookie
based session.. that way the url itself will contain the session.
--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Mehdi" <no****@leavemealone.nowhere> wrote in message
news:#o**************@TK2MSFTNGP09.phx.gbl...
Dave,

Thanks for the suggestion but window.open(...) occures when a hyperlink
is
clicked. Unfortuntely I can not ask users of my site to open another
instance of their browser and type the whole url in the address bar.

Regards
Mehdi

"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message news:Oq**************@TK2MSFTNGP09.phx.gbl...
> window.open or file >> new >> window or target=_blank causes a new
> instance
> of IE which shares the same session as the window from which it was
> executed.
>
> if you need it to have a different session, open a new instance of
> IE...
> say
> using quick lauch browser icon or from you start menu. The instance
> started
> that way will not share the session with the other instances.
>
> --
>
> Regards,
>
> Hermit Dave
> (http://hdave.blogspot.com)
> "Mehdi" <no****@leavemealone.nowhere> wrote in message
> news:OM**************@TK2MSFTNGP15.phx.gbl...
>> Hi,
>>
>> In my asp.net (C#) application I use javascript(i.e
>> window.open('/MyApplication/home.aspx?userid=345', '', '')) to open
> another
>> copy of my application in a new window.
>>
>> In global.asax I set a Session["UserId"] based on

QueryString["userid"].
>> Obviously when I open a new window, the original session of the first >> calling window changes as well, but I need to be unchanged. How can I >> achieve this?
>>
>>
>> Thanks for your time
>>
>>
>>
>> Kind Regards
>>
>>
>> Mehdi
>>
>>
>>
>
>



Nov 18 '05 #6
Dave,

I think I need to change my design approach. Thanks for replying.
Regards
Mehdi
Nov 18 '05 #7

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

Similar topics

2
by: The Plankmeister | last post by:
Hi... I'm trying my hardest to understand fully how sessions work and how best to use them. However, all I can find is information that doesn't tell me anything other than that sessions store...
13
by: jing_li | last post by:
Hi, you all, I am a newbee for php and I need your help. One of my coworker and I are both developing a webpage for our project using php. We have a copy of the same files in different location...
3
by: Maxime Ducharme | last post by:
Hi group We have a problem with sessions in one of our sites. Sessions are used to store login info & some other infos (no objects are stored in sessions). We are using Windows 2000 Server...
3
by: Will Woodhull | last post by:
Hi, I'm new here-- I've been reading the group for a couple of days. Nice group; I like the way n00b33 questions are handled. I've been using a Javascript routine in index.html to determine a...
2
by: Steve Franks | last post by:
According to the docs you tell ASP.NET to use cookieless sessions by setting a value in the config.web file. However, what if I wanted to determine at run time whether or not I wanted to use...
12
by: D. Shane Fowlkes | last post by:
This is a repost (pasted below). Since my original post, I've double checked the system clock and set all IIS Session Timeout values to 10 minutes. Still ...the problem occurs. I've also...
22
by: magic_hat60622 | last post by:
Hi all. I've got an app that dumps a user id into a session after successful login. the login page is http://www.mydomain.com/login.php. If the user visits pages on my site without the www (i.e.,...
13
Frinavale
by: Frinavale | last post by:
One of the most fundamental topics in web design is understanding how to pass information collected on one web page to another web page. There are many different ways you could do this: Cookies,...
3
Atli
by: Atli | last post by:
Introduction: Sessions are one of the simplest and more powerful tools in a web developers arsenal. This tool is invaluable in dynamic web page development and it is one of those things every...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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
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,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.