session

ASP.net MVC - ViewModel object and Session variables

Say I have the following situation: A paginated View displays a list of contacts with the following route: Contacts/Index/Page/2. The View gets its paginated data ViewModel object. The View also gets its filter properties from the ViewModel, like the Contact Category. I would like to store the page number and the filter properties ...

Relative links automatically gain the session ID

Hello, Because the session ID is inserted in the current URL, relative links also automatically gain the session ID. In other words, if the user is currently stationed on Page1.aspx and clicks a relative link to Page2.aspx, the relative link includes the current session ID as part of the URL. The only real limitation of cookieless ...

Looping Through All a Server's Sessions in PHP

Is there a way in PHP to get a list of all sessions (and the variables within each) on the server? Basically, we have a maintenance function which needs to know which users are currently logged into the site. We already store data for each user in a session variable, but I am hoping that I can loop through each of these sessions and pl...

How do I set urlpatterns based on domain name or TLD, in Django?

How do I set urlpatterns based on domain name or TLD, in Django? For some links, Amazon shows url in native language based on its website tld. http://www.amazon.de/bücher-buch-literatur/ ( de : books => bücher ) http://www.amazon.fr/Nouveautés-paraître-Livres/ ( fr : books => Livres ) http://www.amazon.co.jp/和書-ユーズドブッ-英語学習/ ( ...

Enumerate printers for a specific Terminal Server session

I am looking for a way to see what printers a specific user has mapped into his or her TS session. How can I achieve this with WMI (via PowerShell) or VB-Script? Is there a built-in way I'm not aware of? EDIT: In our construct mapping of local printers by the RDP-Client is disabled. Users get their printers created during login via VBS...

Do AJAX requests retain PHP Session info?

If I had a user logged onto my site, having his id stored in $_SESSION, and from his browser he clicked a 'Save' button which would make an AJAX request to the server. Will his $_SESSION and cookies be retained in this request, and can I safely rely on the id being present in the $_SESSION? ...

Losing session state after close of a window opened with window.open

Currently we're opening a new aspx page with window.open. The window.open is in a javascript function (openNewWindow()) in the current aspx page which is called when an asp.net hyperlink control is clicked. The links are dynamically created on the page by our framework and so I'd like to avoid changing that functionality. The problem ...

Single sign on for multisite application across domains in rails 2.3.2

There's a rails recipe that illustrates how to do this in rails 2, but now that sexy rack is in, the solution seemed no longer relevant. How can this be handled in rails 2.3.2? ...

Find Number of Open Sessions

I'm looking for an easy (no database) method of listing how many users are active on a website. The easiest way I can come up with is by counting the number of open sessions. This code should work: $number_of_users = count(scandir(ini_get("session.save_path"))); Of course it won't because of the security constraints on that director...

Server allowing only one request per session

Scenario: All pages of xyz.com use sessions to check if I am logged in and display customized content. I am logged into xyz.com using Firefox on my iMac. Now, when I try to visit, xyz.com/page1.php and xyz.com/page2.php at the same time, until page1 loads page2 is not processed. Code Samples xyz.com/contains (links): /* session che...

session lost on redirect

I have a web app that is being hit by facebook. The login page retrieves the keys that I need and sets some session variables. When the server then redirects the user to the next page, the session information is lost. I’m running the IIS engine on vista ultimate at the moment, the app pools don’t matter because I’m using a state servi...

How do you clear a single entry from a ruby on rails session ?

In ruby on rails when doing session[:foo] = nil it leaves an entry named :foo in the session object. How can you get rid of that single entry from the session object? ...

Securely implementing session state and 'keep me logged in' feature

I would like to improve security on a current application regarding session management and I want the users to be logged in until they explicitly logout. How does one implement that securely? Keep session information in database, like sessionid, ip, useragent? Please provide the requirements, possibly a database layout, do's and don't...

Saving and restoring application window state

I have a lot of session state when programming - shell windows, ides, virtual machines, web browsers. This is all lost when the session ends i.e. when logging out or rebooting. Is there a way to save the desktop state on MS Windows XP and have it restored later? Ideally the solution would allow multiple sessions to be saved and allow ...

Combining cookies and sessions

This question Is a result of various questions I had today about cookies. As you know it's not save to handle the login process with cookies. But how can I set a cookie when I am logged in and to be automatically loggedon when I restart my browser? If I redirect based on the existense of the cookie this is dangerous as someone els...

TSQL Writing into a Temporary Table from Dynamic SQL

Consider the following code: SET @SQL1 = 'SELECT * INTO #temp WHERE ...' exec(@SQL1) SELECT * from #temp (this line throws an error that #temp doesn't exist) Apparently this is because the exec command spins off a separate session and #temp is local to that session. I can use a global temporary table ##temp, but then I have to come ...

Any suggestions on how to session proof a website?

This might be a very odd question, but some hints or guidelines will be very helpful. We want to "session proof" our web site, basically make sure that two different sessions generate the same link structure (e.g. Both user-a and user-b will get the same links in the same web page). The reason behind this test, is that our web site i...

Holding userid in ASP.net

I am using ASP.net for developing an intranet website. I need to hold the userid across all postbacks for all the pages in the website. Is it advisable to hold those information in Session or somether way is available. ...

User session management in asp.net

Hi, my client has had a security audit of a system I built for them complete. They want it to work in such a way that if a user logs in via Internet Explorer that when they login via Firefox on the same machine (or via IE on another machine) that it kills the first session. Essentially this means storing session info in the DB i would ...

How to send a session message to an anonymous user in a Django site?

I often show messages about user actions to logged in users in my Django app views using: request.user.message_set.create("message to user") How could I do the same for anonymous (not logged in) users? There is no request.user for anonymous users, but the Django documentation says that using the "session" middleware you can do the sa...